diff --git a/magic/src/WIP/rivulet.c b/magic/src/WIP/rivulet.c index d82e10f6d..256b5ba23 100644 --- a/magic/src/WIP/rivulet.c +++ b/magic/src/WIP/rivulet.c @@ -61,7 +61,7 @@ Uint32 rivulet_api_version(void) return (TP_MAGIC_API_VERSION); } -int rivulet_init(magic_api * api) +int rivulet_init(magic_api *api) { char fname[1024]; @@ -107,13 +107,13 @@ int rivulet_init(magic_api * api) return (1); } -int rivulet_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int rivulet_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *rivulet_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *rivulet_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -122,32 +122,32 @@ SDL_Surface *rivulet_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *rivulet_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *rivulet_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Rivulet")); } -int rivulet_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rivulet_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } -char *rivulet_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *rivulet_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (gettext("Click and drag downward to add water rivulets to your drawing")); } -int rivulet_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rivulet_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -int rivulet_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rivulet_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -void rivulet_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void rivulet_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (snd_effect != NULL) Mix_FreeChunk(snd_effect); @@ -176,8 +176,8 @@ void rivulet_shutdown(magic_api * api ATTRIBUTE_UNUSED) void -rivulet_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +rivulet_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { riv_x = x; riv_y = y - 1; @@ -196,9 +196,9 @@ rivulet_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, void -rivulet_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox ATTRIBUTE_UNUSED, - int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +rivulet_drag(magic_api *api ATTRIBUTE_UNUSED, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, + int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { int old_riv_x, old_riv_y; @@ -231,8 +231,8 @@ rivulet_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canvas, } -void rivulet_release(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y, /* ignored and reused in a for-loop */ - SDL_Rect * update_rect) +void rivulet_release(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y, /* ignored and reused in a for-loop */ + SDL_Rect *update_rect) { int src_x, src_y, idx; double radius, angle_deg, angle_rad; @@ -311,14 +311,14 @@ void rivulet_release(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * } -void rivulet_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect) +void rivulet_set_color(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect) { } void rivulet_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api; SDL_Rect dest; @@ -395,8 +395,8 @@ void rivulet_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED, } } -void rivulet_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void rivulet_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { if (riv_radii == NULL) { @@ -442,13 +442,13 @@ void rivulet_switchin(magic_api * api ATTRIBUTE_UNUSED, SDL_BlitSurface(canvas, NULL, rivulet_snapshot, NULL); } -void rivulet_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rivulet_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { zero_riv_arrays(canvas); } -void zero_riv_arrays(SDL_Surface * canvas) +void zero_riv_arrays(SDL_Surface *canvas) { if (riv_radii != NULL) memset(riv_radii, 0, (canvas->w * canvas->h)); diff --git a/magic/src/WIP/specular.c b/magic/src/WIP/specular.c index 6840be6a5..bd2fe4485 100644 --- a/magic/src/WIP/specular.c +++ b/magic/src/WIP/specular.c @@ -39,7 +39,7 @@ Uint32 specular_api_version(void) return (TP_MAGIC_API_VERSION); } -int specular_init(magic_api * api, Uint8 disabled_features, Uint8 complexity_level) +int specular_init(magic_api *api, Uint8 disabled_features, Uint8 complexity_level) { int i; char filename[1024]; @@ -51,12 +51,12 @@ int specular_init(magic_api * api, Uint8 disabled_features, Uint8 complexity_lev } -int specular_get_tool_count(magic_api * api) +int specular_get_tool_count(magic_api *api) { return (1); } -SDL_Surface *specular_get_icon(magic_api * api, int which) +SDL_Surface *specular_get_icon(magic_api *api, int which) { char filename[1024]; @@ -66,13 +66,13 @@ SDL_Surface *specular_get_icon(magic_api * api, int which) } -char *specular_get_name(magic_api * api, int which) +char *specular_get_name(magic_api *api, int which) { return strdup(gettext("Specular Reflection")); } -int specular_get_group(magic_api * api, int which) +int specular_get_group(magic_api *api, int which) { return MAGIC_TYPE_PAINTING; } @@ -84,7 +84,7 @@ int specular_get_order(int which) } -char *specular_get_description(magic_api * api, int which, int mode) +char *specular_get_description(magic_api *api, int which, int mode) { return strdup(gettext @@ -92,31 +92,31 @@ char *specular_get_description(magic_api * api, int which, int mode) } -int specular_requires_colors(magic_api * api, int which) +int specular_requires_colors(magic_api *api, int which) { return 0; } -int specular_modes(magic_api * api, int which) +int specular_modes(magic_api *api, int which) { return MODE_PAINT; } -Uint8 specular_accepted_sizes(magic_api * api, int which, int mode) +Uint8 specular_accepted_sizes(magic_api *api, int which, int mode) { return 4; } -Uint8 specular_default_size(magic_api * api, int which, int mode) +Uint8 specular_default_size(magic_api *api, int which, int mode) { return 2; } -void specular_shutdown(magic_api * api) +void specular_shutdown(magic_api *api) { if (snd_effect != NULL) { @@ -126,16 +126,16 @@ void specular_shutdown(magic_api * api) void -specular_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +specular_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { specular_drag(api, which, canvas, snapshot, x, y, x, y, update_rect); } void -specular_drag(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int old_x, int old_y, int x, int y, SDL_Rect * update_rect) +specular_drag(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int old_x, int old_y, int x, int y, SDL_Rect *update_rect) { SDL_LockSurface(snapshot); SDL_LockSurface(canvas); @@ -169,24 +169,24 @@ specular_drag(magic_api * api, int which, } void -specular_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +specular_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { } -void specular_set_color(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * snapshot, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect) +void specular_set_color(magic_api *api, int which, SDL_Surface *canvas, SDL_Surface *snapshot, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect) { } -void specular_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * snapshot, Uint8 size, - SDL_Rect * update_rect) +void specular_set_size(magic_api *api, int which, int mode, SDL_Surface *canvas, SDL_Surface *snapshot, Uint8 size, + SDL_Rect *update_rect) { specular_size = size * 16; } -void specular_line_callback(void *pointer, int which, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y) +void specular_line_callback(void *pointer, int which, SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y) { magic_api *api = (magic_api *) pointer; int xx, yy, ysrc; @@ -214,10 +214,10 @@ void specular_line_callback(void *pointer, int which, SDL_Surface * canvas, SDL_ } } -void specular_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas) +void specular_switchin(magic_api *api, int which, int mode, SDL_Surface *canvas) { } -void specular_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas) +void specular_switchout(magic_api *api, int which, int mode, SDL_Surface *canvas) { } diff --git a/magic/src/WIP/warp.c b/magic/src/WIP/warp.c index eedf31c45..4e44cbf4b 100644 --- a/magic/src/WIP/warp.c +++ b/magic/src/WIP/warp.c @@ -110,7 +110,7 @@ Uint32 warp_api_version(void) } // Load our sfx: -int warp_init(magic_api * api, Uint32 disabled_features ATTRIBUTE_UNUSED) +int warp_init(magic_api *api, Uint32 disabled_features ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -125,13 +125,13 @@ int warp_init(magic_api * api, Uint32 disabled_features ATTRIBUTE_UNUSED) } // We have multiple tools: -int warp_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int warp_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return NUM_TOOLS; } // Load our icons: -SDL_Surface *warp_get_icon(magic_api * api, int which) +SDL_Surface *warp_get_icon(magic_api *api, int which) { char fname[1024]; @@ -140,26 +140,26 @@ SDL_Surface *warp_get_icon(magic_api * api, int which) } // Return our names, localized: -char *warp_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *warp_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(warp_tool_names[which]))); } // Return our group: -int warp_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int warp_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } // Return our descriptions, localized: -char *warp_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *warp_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext_noop("Warp"))); // FIXME } // Affect the canvas on drag: -void warp_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void warp_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { int xx, yy; float stroke_len; @@ -229,7 +229,7 @@ void warp_drag(magic_api * api, int which, SDL_Surface * canvas, api->playsound(warp_snd[which], (x * 255) / canvas->w, 255); } -static void warp_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void warp_linecb(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { float intensity; magic_api *api = (magic_api *) ptr; @@ -255,8 +255,8 @@ static void warp_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surface } // Affect the canvas on click: -void warp_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void warp_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (warp_mesh == NULL) return; @@ -266,16 +266,16 @@ void warp_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, warp_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void warp_release(magic_api * api ATTRIBUTE_UNUSED, +void warp_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Clean up -void warp_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void warp_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -286,20 +286,20 @@ void warp_shutdown(magic_api * api ATTRIBUTE_UNUSED) } } -void warp_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void warp_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -int warp_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int warp_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void warp_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void warp_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { int x, y; @@ -335,8 +335,8 @@ void warp_switchin(magic_api * api ATTRIBUTE_UNUSED, } } -void warp_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void warp_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { int y; @@ -360,25 +360,25 @@ void warp_switchout(magic_api * api ATTRIBUTE_UNUSED, } } -int warp_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int warp_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 warp_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 warp_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return NUM_WARP_SIZES; } -Uint8 warp_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 warp_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (NUM_WARP_SIZES / 2); } -void warp_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void warp_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { warp_radius = (size * MAX_WARP_RADIUS) / NUM_WARP_SIZES; } diff --git a/magic/src/alien.c b/magic/src/alien.c index 22e8c6fae..f2377215a 100644 --- a/magic/src/alien.c +++ b/magic/src/alien.c @@ -115,7 +115,7 @@ Uint32 alien_api_version(void) } //Load sounds -int alien_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int alien_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -130,13 +130,13 @@ int alien_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int alien_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int alien_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (alien_NUM_TOOLS); } // Load our icons: -SDL_Surface *alien_get_icon(magic_api * api, int which) +SDL_Surface *alien_get_icon(magic_api *api, int which) { char fname[1024]; @@ -145,12 +145,12 @@ SDL_Surface *alien_get_icon(magic_api * api, int which) } // Return our names, localized: -char *alien_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *alien_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(alien_names[which]))); } -int alien_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int alien_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { return alien_groups[which]; } @@ -161,14 +161,14 @@ int alien_get_order(int which) } // Return our descriptions, localized: -char *alien_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *alien_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return (strdup(gettext(alien_descs[which][mode - 1]))); } //Do the effect for one pixel static void do_alien_pixel(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -190,7 +190,7 @@ static void do_alien_pixel(void *ptr, int which ATTRIBUTE_UNUSED, } // Do the effect for the full image -static void do_alien_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) +static void do_alien_full(void *ptr, SDL_Surface *canvas, SDL_Surface *last, int which) { int x, y; @@ -204,7 +204,7 @@ static void do_alien_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, i } //do the effect for the brush -static void do_alien_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_alien_brush(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { int xx, yy; magic_api *api = (magic_api *) ptr; @@ -222,8 +222,8 @@ static void do_alien_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surfa } // Affect the canvas on drag: -void alien_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void alien_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_alien_brush); @@ -266,8 +266,8 @@ Mix_Chunk *magic_loadsound(char *file) } // Affect the canvas on click: -void alien_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void alien_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) alien_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -283,16 +283,16 @@ void alien_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void alien_release(magic_api * api ATTRIBUTE_UNUSED, +void alien_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void alien_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void alien_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -307,47 +307,47 @@ void alien_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void alien_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void alien_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int alien_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int alien_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -Uint8 alien_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 alien_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 6; } -Uint8 alien_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 alien_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void alien_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void alien_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { alien_RADIUS = size * 4; } -void alien_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void alien_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void alien_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void alien_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int alien_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int alien_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN | MODE_PAINT); } diff --git a/magic/src/ascii.c b/magic/src/ascii.c index b6723f9cd..eacc534f3 100644 --- a/magic/src/ascii.c +++ b/magic/src/ascii.c @@ -39,7 +39,8 @@ #include "SDL_image.h" #include "SDL_mixer.h" -enum { +enum +{ TOOL_TYPEWRITER, TOOL_COMPUTER, NUM_TOOLS @@ -47,13 +48,13 @@ enum { #define TOOL_COMPUTER_COLOR NUM_TOOLS -char * ascii_tool_names[NUM_TOOLS + 1] = { +char *ascii_tool_names[NUM_TOOLS + 1] = { gettext_noop("Typewriter"), gettext_noop("Computer"), - gettext_noop("Color Computer"), // special version of "computer" + gettext_noop("Color Computer"), // special version of "computer" }; -char * ascii_tool_filenames[NUM_TOOLS + 1] = { +char *ascii_tool_filenames[NUM_TOOLS + 1] = { "typewriter", "computer", "color_computer", @@ -67,12 +68,12 @@ static Mix_Chunk *ascii_snd[NUM_TOOLS]; * poistion, how many characters there are, and the maximum width. */ #define MAX_CHARS 256 -SDL_Surface * ascii_bitmap[NUM_TOOLS]; +SDL_Surface *ascii_bitmap[NUM_TOOLS]; int ascii_char_x[NUM_TOOLS][MAX_CHARS]; int ascii_num_chars[NUM_TOOLS]; int ascii_char_maxwidth[NUM_TOOLS]; int ascii_char_brightness[NUM_TOOLS][MAX_CHARS]; -SDL_Surface * ascii_snapshot = NULL; +SDL_Surface *ascii_snapshot = NULL; int ascii_size; Uint8 ascii_r, ascii_g, ascii_b; Uint8 ascii_clear_r[NUM_TOOLS], ascii_clear_g[NUM_TOOLS], ascii_clear_b[NUM_TOOLS]; @@ -80,22 +81,22 @@ Uint8 ascii_clear_r[NUM_TOOLS], ascii_clear_g[NUM_TOOLS], ascii_clear_b[NUM_TOOL /* Based on CGA color palette */ const Uint8 ascii_computer_colors[16][3] = { - { 0x00, 0x00, 0x00 }, // Black - { 0x55, 0x55, 0x55 }, // Dark gray - { 0xAA, 0xAA, 0xAA }, // Light gray - { 0xFF, 0xFF, 0xFF }, // White - { 0x00, 0x00, 0xAA }, // Blue - { 0x55, 0x55, 0xFF }, // Light blue - { 0x00, 0xAA, 0x00 }, // Green - { 0x55, 0xFF, 0x55 }, // Light green - { 0x00, 0xAA, 0xAA }, // Cyan - { 0x55, 0xFF, 0xFF }, // Light cyan - { 0xAA, 0x00, 0x00 }, // Red - { 0xFF, 0x55, 0x55 }, // Light red - { 0xAA, 0x00, 0xAA }, // Magenta - { 0xFF, 0x55, 0xFF }, // Light magenta - { 0xAA, 0x55, 0x00 }, // Brown - { 0xFF, 0xFF, 0x55 }, // Yellow + {0x00, 0x00, 0x00}, // Black + {0x55, 0x55, 0x55}, // Dark gray + {0xAA, 0xAA, 0xAA}, // Light gray + {0xFF, 0xFF, 0xFF}, // White + {0x00, 0x00, 0xAA}, // Blue + {0x55, 0x55, 0xFF}, // Light blue + {0x00, 0xAA, 0x00}, // Green + {0x55, 0xFF, 0x55}, // Light green + {0x00, 0xAA, 0xAA}, // Cyan + {0x55, 0xFF, 0xFF}, // Light cyan + {0xAA, 0x00, 0x00}, // Red + {0xFF, 0x55, 0x55}, // Light red + {0xAA, 0x00, 0xAA}, // Magenta + {0xFF, 0x55, 0xFF}, // Light magenta + {0xAA, 0x55, 0x00}, // Brown + {0xFF, 0xFF, 0x55}, // Yellow }; Uint32 ascii_api_version(void); @@ -108,17 +109,17 @@ int ascii_get_order(int which); char *ascii_get_description(magic_api * api, int which, int mode); void ascii_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); + SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); void ascii_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void ascii_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void ascii_shutdown(magic_api * api); void ascii_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); + SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); int ascii_requires_colors(magic_api * api, int which); void ascii_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void ascii_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas); @@ -126,7 +127,7 @@ int ascii_modes(magic_api * api, int which); Uint8 ascii_accepted_sizes(magic_api * api, int which, int mode); Uint8 ascii_default_size(magic_api * api, int which, int mode); void ascii_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, - SDL_Rect * update_rect); + SDL_Rect * update_rect); void do_ascii_effect(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y); int get_best_char(int which, int brightness); int get_bright(magic_api * api, int r, int g, int b); @@ -137,7 +138,7 @@ Uint32 ascii_api_version(void) return (TP_MAGIC_API_VERSION); } -int ascii_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int ascii_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; int i, j, x, y, xx, w, num_chars, all_clear, area, bright, clear_brightness; @@ -166,7 +167,7 @@ int ascii_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 if (ascii_bitmap[i] == NULL) { fprintf(stderr, "Cannot load %s\n", fname); - return(0); + return (0); } clear_pixel = api->getpixel(ascii_bitmap[i], 0, 0); @@ -184,7 +185,8 @@ int ascii_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 do { all_clear = 1; - for (y = 0; y < ascii_bitmap[i]->h /* && all_clear */; y++) { + for (y = 0; y < ascii_bitmap[i]->h /* && all_clear */ ; y++) + { pixel = api->getpixel(ascii_bitmap[i], x, y); if (pixel != clear_pixel) all_clear = 0; @@ -201,7 +203,7 @@ int ascii_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 for (xx = x; xx < ascii_bitmap[i]->w && !all_clear; xx++) { all_clear = 1; - for (y = 0; y < ascii_bitmap[i]->h /* && all_clear */; y++) + for (y = 0; y < ascii_bitmap[i]->h /* && all_clear */ ; y++) { pixel = api->getpixel(ascii_bitmap[i], xx, y); if (pixel != clear_pixel) @@ -250,7 +252,8 @@ int ascii_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 /* Calculate the intensity of each character */ area = ascii_char_maxwidth[i] * ascii_bitmap[i]->h; - DEBUG_PRINTF("%s max char width is %d -- * %d = area %d\n", fname, ascii_char_maxwidth[i], ascii_bitmap[i]->h, area); + DEBUG_PRINTF("%s max char width is %d -- * %d = area %d\n", fname, ascii_char_maxwidth[i], ascii_bitmap[i]->h, + area); for (j = 0; j < num_chars; j++) { @@ -268,7 +271,7 @@ int ascii_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 DEBUG_PRINTF("\n"); } DEBUG_PRINTF("char %3d brightness = %3d before padding -- ", j, bright / area); - w = ascii_char_maxwidth[i] - (ascii_char_x[i][j + 1] - ascii_char_x[i][j]) - 2; /* don't let padding affect _too_ much */ + w = ascii_char_maxwidth[i] - (ascii_char_x[i][j + 1] - ascii_char_x[i][j]) - 2; /* don't let padding affect _too_ much */ if (w >= 1) bright += (clear_brightness * ascii_bitmap[i]->h * w); DEBUG_PRINTF("%3d after padding %d width\n", bright / area, w); @@ -301,12 +304,12 @@ int ascii_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int ascii_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int ascii_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS + 1); } -SDL_Surface *ascii_get_icon(magic_api * api, int which) +SDL_Surface *ascii_get_icon(magic_api *api, int which) { char fname[1024]; @@ -315,15 +318,15 @@ SDL_Surface *ascii_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *ascii_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *ascii_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { char tmp[1024]; snprintf(tmp, sizeof(tmp), gettext("ASCII %s"), gettext(ascii_tool_names[which])); - return(strdup(tmp)); + return (strdup(tmp)); } -int ascii_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ascii_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -333,20 +336,22 @@ int ascii_get_order(int which) return 2050 + which; } -char *ascii_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *ascii_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { char tmp[1024]; if (mode == MODE_PAINT) - snprintf(tmp, sizeof(tmp), gettext("Click and drag to transform parts of your drawing to ASCII art (%s style)."), gettext(ascii_tool_names[which])); + snprintf(tmp, sizeof(tmp), gettext("Click and drag to transform parts of your drawing to ASCII art (%s style)."), + gettext(ascii_tool_names[which])); else - snprintf(tmp, sizeof(tmp), gettext("Click to transform your entire drawing to ASCII art (%s style)."), gettext(ascii_tool_names[which])); + snprintf(tmp, sizeof(tmp), gettext("Click to transform your entire drawing to ASCII art (%s style)."), + gettext(ascii_tool_names[which])); - return(strdup(tmp)); + return (strdup(tmp)); } -void ascii_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void ascii_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_ascii_effect); @@ -362,8 +367,8 @@ void ascii_drag(magic_api * api, int which, SDL_Surface * canvas, api->playsound(ascii_snd[which], (x * 255) / canvas->w, 255); } -void ascii_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void ascii_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) ascii_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -393,15 +398,15 @@ void ascii_click(magic_api * api, int which, int mode, } } -void ascii_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void ascii_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { api->stopsound(); } -void ascii_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void ascii_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -420,13 +425,12 @@ void ascii_shutdown(magic_api * api ATTRIBUTE_UNUSED) } } -void ascii_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void ascii_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { /* If the bitmap's "clear" color, choose the opposite! */ - if (abs(r - ascii_clear_r[which]) < 8 && - abs(g - ascii_clear_g[which]) < 8 && - abs(b - ascii_clear_b[which]) < 8) + if (abs(r - ascii_clear_r[which]) < 8 && abs(g - ascii_clear_g[which]) < 8 && abs(b - ascii_clear_b[which]) < 8) { r = 255 - r; g = 255 - g; @@ -438,7 +442,7 @@ void ascii_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE ascii_b = b; } -int ascii_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ascii_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { if (which == TOOL_TYPEWRITER || which == TOOL_COMPUTER) return 1; @@ -446,8 +450,8 @@ int ascii_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ return 0; } -void ascii_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void ascii_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { if (ascii_snapshot == NULL) ascii_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h, @@ -464,18 +468,18 @@ void ascii_switchin(magic_api * api ATTRIBUTE_UNUSED, } } -void ascii_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void ascii_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int ascii_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ascii_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 ascii_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 ascii_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { if (mode == MODE_PAINT) return 6; @@ -483,7 +487,7 @@ Uint8 ascii_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE return 0; } -Uint8 ascii_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 ascii_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 3; @@ -491,14 +495,14 @@ Uint8 ascii_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U return 0; } -void ascii_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void ascii_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { ascii_size = size; } -void do_ascii_effect(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) +void do_ascii_effect(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int w, h, n, sx, sy, xx, yy, ww, brightness, rr, gg, bb; @@ -610,8 +614,7 @@ void do_ascii_effect(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * l for (i = 0; i < 16; i++) { if (rr == ascii_computer_colors[i][0] && - gg == ascii_computer_colors[i][1] && - bb == ascii_computer_colors[i][2]) + gg == ascii_computer_colors[i][1] && bb == ascii_computer_colors[i][2]) { /* Exact match */ best = i; @@ -629,8 +632,7 @@ void do_ascii_effect(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * l bb == ascii_computer_colors[i][2] && abs(rr - ascii_computer_colors[i][0]) <= 0x55) || (bb == ascii_computer_colors[i][2] && - rr == ascii_computer_colors[i][0] && - abs(gg - ascii_computer_colors[i][1]) <= 0x55)) + rr == ascii_computer_colors[i][0] && abs(gg - ascii_computer_colors[i][1]) <= 0x55)) { /* Very close match */ best = i; @@ -649,8 +651,7 @@ void do_ascii_effect(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * l abs(bb - ascii_computer_colors[i][2]) <= 0x55 && abs(rr - ascii_computer_colors[i][0]) <= 0x55) || (bb == ascii_computer_colors[i][2] && - abs(rr - ascii_computer_colors[i][0]) <= 0x55 && - abs(gg - ascii_computer_colors[i][1]) <= 0x55)) + abs(rr - ascii_computer_colors[i][0]) <= 0x55 && abs(gg - ascii_computer_colors[i][1]) <= 0x55)) { /* Pretty close match */ best = i; @@ -660,7 +661,7 @@ void do_ascii_effect(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * l DEBUG_PRINTF("best for %02x%02x%02x = %d: ", rr, gg, bb, best); if (best == -1) - best = 0; // oops! + best = 0; // oops! rr = ascii_computer_colors[best][0]; gg = ascii_computer_colors[best][1]; bb = ascii_computer_colors[best][2]; @@ -731,12 +732,12 @@ int get_best_char(int which, int brightness) } DEBUG_PRINTF("best for brightness %d is %d (brightness %d)\n", - brightness, best_idx, ascii_char_brightness[which][best_idx]); + brightness, best_idx, ascii_char_brightness[which][best_idx]); return best_idx; } -int get_bright(magic_api * api, int r, int g, int b) +int get_bright(magic_api *api, int r, int g, int b) { float fr, fg, fb, y; @@ -746,5 +747,5 @@ int get_bright(magic_api * api, int r, int g, int b) y = (0.2126 * fr) + (0.7152 * fg) + (0.0722 * fb); - return (int) (y * 255); + return (int)(y * 255); } diff --git a/magic/src/blind.c b/magic/src/blind.c index 5d5f22466..ecb981b72 100644 --- a/magic/src/blind.c +++ b/magic/src/blind.c @@ -88,9 +88,9 @@ Uint32 blind_api_version(void) return (TP_MAGIC_API_VERSION); } -void blind_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void blind_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { //get the colors from API and store it in structure blind_r = r; @@ -98,7 +98,7 @@ void blind_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE blind_b = b; } -int blind_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int blind_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -108,12 +108,12 @@ int blind_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int blind_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int blind_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return BLIND_NUMTOOLS; } -SDL_Surface *blind_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *blind_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -122,12 +122,12 @@ SDL_Surface *blind_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *blind_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *blind_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Blind")); } -int blind_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int blind_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_DECORATIONS; } @@ -137,27 +137,27 @@ int blind_get_order(int which ATTRIBUTE_UNUSED) return 100; } -char *blind_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *blind_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext ("Click towards the edge of your picture to pull window blinds over it. Move perpendicularly to open or close the blinds.")); } -int blind_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int blind_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void blind_release(magic_api * api ATTRIBUTE_UNUSED, +void blind_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void blind_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void blind_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(blind_snd); } @@ -165,7 +165,7 @@ void blind_shutdown(magic_api * api ATTRIBUTE_UNUSED) // Interactivity functions void blind_paint_blind(void *ptr_to_api, int which_tool ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr_to_api; @@ -184,8 +184,8 @@ void blind_paint_blind(void *ptr_to_api, int which_tool ATTRIBUTE_UNUSED, } */ -void blind_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void blind_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { int opaque; @@ -291,8 +291,8 @@ void blind_drag(magic_api * api, int which, SDL_Surface * canvas, } } -void blind_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void blind_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (y < canvas->h / 2) @@ -317,35 +317,35 @@ void blind_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, blind_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void blind_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void blind_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void blind_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void blind_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int blind_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int blind_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 blind_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 blind_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 blind_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 blind_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void blind_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void blind_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/blocks_etc.c b/magic/src/blocks_etc.c index 8962e75e4..a9ecdc7c4 100644 --- a/magic/src/blocks_etc.c +++ b/magic/src/blocks_etc.c @@ -81,7 +81,7 @@ void blocks_etc_set_size(magic_api * api, int which, int mode, SDL_Surface * can -int blocks_etc_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int blocks_etc_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -104,13 +104,13 @@ Uint32 blocks_etc_api_version(void) // We have multiple tools: -int blocks_etc_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int blocks_etc_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } // Load our icons: -SDL_Surface *blocks_etc_get_icon(magic_api * api, int which) +SDL_Surface *blocks_etc_get_icon(magic_api *api, int which) { char fname[1024]; @@ -131,7 +131,7 @@ SDL_Surface *blocks_etc_get_icon(magic_api * api, int which) } // Return our names, localized: -char *blocks_etc_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *blocks_etc_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == TOOL_BLOCKS) return (strdup(gettext("Blocks"))); @@ -144,7 +144,7 @@ char *blocks_etc_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) } // Return our group (all the same): -int blocks_etc_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int blocks_etc_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -170,7 +170,7 @@ int blocks_etc_get_order(int which) } // Return our descriptions, localized: -char *blocks_etc_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *blocks_etc_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { if (which == TOOL_BLOCKS) { @@ -211,7 +211,7 @@ char *blocks_etc_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, in // Do the effect: -static void blocks_etc_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void blocks_etc_linecb(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -321,8 +321,8 @@ static void blocks_etc_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Su } // Affect the canvas on drag: -void blocks_etc_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void blocks_etc_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, blocks_etc_linecb); @@ -350,8 +350,8 @@ void blocks_etc_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void blocks_etc_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void blocks_etc_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) { @@ -400,16 +400,16 @@ void blocks_etc_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void blocks_etc_release(magic_api * api ATTRIBUTE_UNUSED, +void blocks_etc_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void blocks_etc_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void blocks_etc_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (snd_effect[0] != NULL) Mix_FreeChunk(snd_effect[0]); @@ -419,41 +419,41 @@ void blocks_etc_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void blocks_etc_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void blocks_etc_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int blocks_etc_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int blocks_etc_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void blocks_etc_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void blocks_etc_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void blocks_etc_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void blocks_etc_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int blocks_etc_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int blocks_etc_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 blocks_etc_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 blocks_etc_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -Uint8 blocks_etc_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 blocks_etc_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { if (which == TOOL_BLOCKS) return 1; @@ -461,9 +461,9 @@ Uint8 blocks_etc_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIB return 2; } -void blocks_etc_set_size(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void blocks_etc_set_size(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { if (which == TOOL_BLOCKS) EFFECT_REZ = size * 4; diff --git a/magic/src/bloom.c b/magic/src/bloom.c index 0539a1f23..9a7331a89 100644 --- a/magic/src/bloom.c +++ b/magic/src/bloom.c @@ -77,7 +77,7 @@ Uint32 bloom_api_version(void) return (TP_MAGIC_API_VERSION); } -int bloom_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int bloom_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -89,12 +89,12 @@ int bloom_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int bloom_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int bloom_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *bloom_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *bloom_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -103,12 +103,12 @@ SDL_Surface *bloom_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *bloom_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *bloom_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Bloom")); } -int bloom_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int bloom_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } @@ -118,7 +118,7 @@ int bloom_get_order(int which ATTRIBUTE_UNUSED) return 900; } -char *bloom_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *bloom_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) { @@ -130,17 +130,17 @@ char *bloom_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT } } -int bloom_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int bloom_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; /* TODO: Maybe some day? */ } -int bloom_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED) +int bloom_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -void bloom_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void bloom_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (snd_effects != NULL) { @@ -156,8 +156,8 @@ void bloom_shutdown(magic_api * api ATTRIBUTE_UNUSED) } void -bloom_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +bloom_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { if (bloom_mask == NULL) return; @@ -189,8 +189,8 @@ bloom_click(magic_api * api, int which, int mode, void -bloom_drag(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +bloom_drag(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { if (bloom_mask == NULL) return; @@ -206,9 +206,9 @@ bloom_drag(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Sur } -void bloom_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, - SDL_Surface * snapshot, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) +void bloom_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, + SDL_Surface *snapshot, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect) { if (bloom_mask == NULL) return; @@ -224,7 +224,7 @@ void bloom_release(magic_api * api, int which ATTRIBUTE_UNUSED, update_rect->h = canvas->h; } -void bloom_apply_effect(magic_api * api, SDL_Surface * canvas, SDL_Surface * snapshot) +void bloom_apply_effect(magic_api *api, SDL_Surface *canvas, SDL_Surface *snapshot) { int sample, offset, offset_flip, x, y, xx, yy; Uint8 r, g, b; @@ -323,18 +323,18 @@ void bloom_apply_effect(magic_api * api, SDL_Surface * canvas, SDL_Surface * sna } -void bloom_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, +void bloom_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { /* TODO: Maybe some day? */ } void bloom_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { int xrad, yrad, xx, yy, chg, n; magic_api *api = (magic_api *) ptr; @@ -374,8 +374,8 @@ void bloom_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED, } -void bloom_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED, int mode, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void bloom_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED, int mode, SDL_Surface *canvas ATTRIBUTE_UNUSED) { if (bloom_mask == NULL) bloom_mask = (Uint8 *) malloc(sizeof(Uint8) * canvas->w * canvas->h); @@ -384,9 +384,9 @@ void bloom_switchin(magic_api * api ATTRIBUTE_UNUSED, bloom_set_size(api, which, mode, NULL, NULL, bloom_default_size(api, which, mode), NULL); } -void bloom_switchout(magic_api * api ATTRIBUTE_UNUSED, +void bloom_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) + int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } @@ -401,7 +401,7 @@ float change_luminance(float c_in, float l_in, float l_out) } -Uint8 bloom_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 bloom_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 4; @@ -409,14 +409,14 @@ Uint8 bloom_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE return 0; } -Uint8 bloom_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 bloom_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void bloom_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void bloom_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { BLOOM_PAINT_RADIUS = size * 12; BLOOM_SPIKE_LENGTH = sqrt(BLOOM_PAINT_RADIUS + 1); diff --git a/magic/src/blur.c b/magic/src/blur.c index 837083687..027b651e3 100644 --- a/magic/src/blur.c +++ b/magic/src/blur.c @@ -105,7 +105,7 @@ Uint32 blur_api_version(void) } //Load sounds -int blur_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int blur_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -118,13 +118,13 @@ int blur_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 c return (1); } -int blur_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int blur_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (blur_NUM_TOOLS); } // Load our icons: -SDL_Surface *blur_get_icon(magic_api * api, int which) +SDL_Surface *blur_get_icon(magic_api *api, int which) { char fname[1024]; @@ -133,13 +133,13 @@ SDL_Surface *blur_get_icon(magic_api * api, int which) } // Return our names, localized: -char *blur_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *blur_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(blur_names[which]))); } // Return our group -int blur_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int blur_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { return blur_groups[which]; } @@ -151,13 +151,13 @@ int blur_get_order(int which) } // Return our descriptions, localized: -char *blur_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *blur_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return (strdup(gettext(blur_descs[which][mode - 1]))); } //Do the effect for one pixel -static void do_blur_pixel(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_blur_pixel(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; int i, j, k; @@ -197,7 +197,7 @@ static void do_blur_pixel(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * c } // Do the effect for the full image -static void do_blur_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) +static void do_blur_full(void *ptr, SDL_Surface *canvas, SDL_Surface *last, int which) { magic_api *api = (magic_api *) ptr; int x, y; @@ -217,7 +217,7 @@ static void do_blur_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, in } //do the effect for the brush -static void do_blur_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_blur_brush(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { int xx, yy; magic_api *api = (magic_api *) ptr; @@ -235,8 +235,8 @@ static void do_blur_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surfac } // Affect the canvas on drag: -void blur_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void blur_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_blur_brush); @@ -265,8 +265,8 @@ void blur_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void blur_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void blur_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) blur_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -282,16 +282,16 @@ void blur_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void blur_release(magic_api * api ATTRIBUTE_UNUSED, +void blur_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void blur_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void blur_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -306,28 +306,28 @@ void blur_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void blur_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, - Uint8 b ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void blur_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, + Uint8 b ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Record the size from Tux Paint: -void blur_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 sz, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void blur_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { blur_RADIUS = sz * 4; } // Use colors: -int blur_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int blur_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -Uint8 blur_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 blur_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -335,22 +335,22 @@ Uint8 blur_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ return 0; } -Uint8 blur_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 blur_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void blur_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void blur_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void blur_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void blur_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int blur_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int blur_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN | MODE_PAINT); } diff --git a/magic/src/bricks.c b/magic/src/bricks.c index 297db637f..1a60976bc 100644 --- a/magic/src/bricks.c +++ b/magic/src/bricks.c @@ -82,7 +82,7 @@ void bricks_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Rect * update_rect); // No setup required: -int bricks_init(magic_api * api, Uint8 disabled_features, Uint8 complexity_level ATTRIBUTE_UNUSED) +int bricks_init(magic_api *api, Uint8 disabled_features, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -103,7 +103,7 @@ Uint32 bricks_api_version(void) } // We have multiple tools: -int bricks_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int bricks_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { if (brick_two_tools) return (NUM_TOOLS); @@ -112,7 +112,7 @@ int bricks_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) } // Load our icons: -SDL_Surface *bricks_get_icon(magic_api * api, int which) +SDL_Surface *bricks_get_icon(magic_api *api, int which) { char fname[1024]; @@ -129,7 +129,7 @@ SDL_Surface *bricks_get_icon(magic_api * api, int which) } // Return our names, localized: -char *bricks_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *bricks_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { /* Both are named "Bricks", at the moment: */ @@ -137,7 +137,7 @@ char *bricks_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS } // Return our group (both the same): -int bricks_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int bricks_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -149,7 +149,7 @@ int bricks_get_order(int which) } // Return our descriptions, localized: -char *bricks_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *bricks_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (brick_two_tools) { @@ -168,7 +168,7 @@ char *bricks_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mo // Do the effect: -static void do_bricks(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) +static void do_bricks(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -255,8 +255,8 @@ static void do_bricks(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * } // Affect the canvas on drag: -void bricks_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void bricks_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_bricks); @@ -286,31 +286,31 @@ void bricks_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void bricks_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void bricks_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { bricks_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void bricks_release(magic_api * api ATTRIBUTE_UNUSED, +void bricks_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void bricks_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void bricks_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (brick_snd != NULL) Mix_FreeChunk(brick_snd); } // Record the color from Tux Paint: -void bricks_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void bricks_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { bricks_r = r; bricks_g = g; @@ -318,12 +318,12 @@ void bricks_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS } // Use colors: -int bricks_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int bricks_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -static void do_brick(magic_api * api, SDL_Surface * canvas, int x, int y, int w, int h) +static void do_brick(magic_api *api, SDL_Surface *canvas, int x, int y, int w, int h) { SDL_Rect dest; @@ -352,35 +352,35 @@ static void do_brick(magic_api * api, SDL_Surface * canvas, int x, int y, int w, api->playsound(brick_snd, (x * 255) / canvas->w, 255); } -void bricks_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void bricks_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void bricks_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void bricks_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int bricks_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int bricks_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 bricks_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 bricks_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -Uint8 bricks_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 bricks_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void bricks_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void bricks_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { if (size == 1) { diff --git a/magic/src/calligraphy.c b/magic/src/calligraphy.c index f64634dfb..303727315 100644 --- a/magic/src/calligraphy.c +++ b/magic/src/calligraphy.c @@ -80,7 +80,7 @@ void calligraphy_set_size(magic_api * api, int which, int mode, SDL_Surface * ca -int calligraphy_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int calligraphy_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -112,13 +112,13 @@ Uint32 calligraphy_api_version(void) } // Only one tool: -int calligraphy_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int calligraphy_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icon: -SDL_Surface *calligraphy_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *calligraphy_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -127,13 +127,13 @@ SDL_Surface *calligraphy_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our name, localized: -char *calligraphy_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *calligraphy_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Calligraphy"))); } // Return our group -int calligraphy_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int calligraphy_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -145,16 +145,16 @@ int calligraphy_get_order(int which ATTRIBUTE_UNUSED) } // Return our description, localized: -char *calligraphy_get_description(magic_api * api ATTRIBUTE_UNUSED, +char *calligraphy_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag the mouse around to draw in calligraphy."))); } -void calligraphy_drag(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void calligraphy_drag(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect *update_rect) { Point2D *curve; int i, n_points, thick, new_thick; @@ -277,10 +277,10 @@ void calligraphy_drag(magic_api * api, int which ATTRIBUTE_UNUSED, api->playsound(calligraphy_snd, (x * 255) / canvas->w, 255); } -void calligraphy_click(magic_api * api ATTRIBUTE_UNUSED, +void calligraphy_click(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { calligraphy_old_thick = 8; calligraphy_last_time = 0; @@ -296,16 +296,16 @@ void calligraphy_click(magic_api * api ATTRIBUTE_UNUSED, } -void calligraphy_release(magic_api * api ATTRIBUTE_UNUSED, +void calligraphy_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void calligraphy_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void calligraphy_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (calligraphy_snd != NULL) Mix_FreeChunk(calligraphy_snd); @@ -316,9 +316,9 @@ void calligraphy_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // We don't use colors -void calligraphy_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void calligraphy_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { int x, y; Uint8 a; @@ -367,7 +367,7 @@ void calligraphy_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surf } // We don't use colors -int calligraphy_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int calligraphy_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } @@ -386,7 +386,7 @@ cp[3] is the end point, or P3 in the above diagram t is the parameter value, 0 <= t <= 1 */ -static Point2D calligraphy_PointOnCubicBezier(Point2D * cp, float t) +static Point2D calligraphy_PointOnCubicBezier(Point2D *cp, float t) { float ax, bx, cx; float ay, by, cy; @@ -422,7 +422,7 @@ static Point2D calligraphy_PointOnCubicBezier(Point2D * cp, float t) */ -static void calligraphy_ComputeBezier(Point2D * cp, int numberOfPoints, Point2D * curve) +static void calligraphy_ComputeBezier(Point2D *cp, int numberOfPoints, Point2D *curve) { float dt; int i; @@ -442,36 +442,35 @@ static float calligraphy_dist(float x1, float y1, float x2, float y2) return d; } -void calligraphy_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void calligraphy_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void calligraphy_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void calligraphy_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int calligraphy_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int calligraphy_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 calligraphy_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED) +Uint8 calligraphy_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -Uint8 calligraphy_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 calligraphy_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void calligraphy_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void calligraphy_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { callig_size = size; } diff --git a/magic/src/cartoon.c b/magic/src/cartoon.c index 85430b6c4..942e6e8a7 100644 --- a/magic/src/cartoon.c +++ b/magic/src/cartoon.c @@ -75,7 +75,7 @@ void cartoon_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas // No setup required: -int cartoon_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int cartoon_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -91,13 +91,13 @@ Uint32 cartoon_api_version(void) } // We have multiple tools: -int cartoon_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int cartoon_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *cartoon_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *cartoon_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -107,13 +107,13 @@ SDL_Surface *cartoon_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *cartoon_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *cartoon_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Cartoon"))); } // Return our groups -int cartoon_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int cartoon_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } @@ -125,7 +125,7 @@ int cartoon_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *cartoon_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *cartoon_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) { @@ -139,7 +139,7 @@ char *cartoon_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIB // Do the effect: -void cartoon_apply_colors(magic_api * api, SDL_Surface * surf, int xx, int yy) +void cartoon_apply_colors(magic_api *api, SDL_Surface *surf, int xx, int yy) { Uint8 r, g, b; float hue, sat, val; @@ -165,7 +165,7 @@ void cartoon_apply_colors(magic_api * api, SDL_Surface * surf, int xx, int yy) } -void cartoon_apply_outline(magic_api * api, int xx, int yy) +void cartoon_apply_outline(magic_api *api, int xx, int yy) { Uint8 r, g, b; Uint8 r1, g1, b1, r2, g2, b2; @@ -189,7 +189,7 @@ void cartoon_apply_outline(magic_api * api, int xx, int yy) static void do_cartoon(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -207,8 +207,8 @@ static void do_cartoon(void *ptr, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void cartoon_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void cartoon_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_cartoon); @@ -236,8 +236,8 @@ void cartoon_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void cartoon_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void cartoon_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { int effect_x, effect_y; @@ -283,37 +283,37 @@ void cartoon_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void cartoon_release(magic_api * api ATTRIBUTE_UNUSED, +void cartoon_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void cartoon_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void cartoon_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (cartoon_snd != NULL) Mix_FreeChunk(cartoon_snd); } // Record the color from Tux Paint: -void cartoon_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void cartoon_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int cartoon_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int cartoon_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void cartoon_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void cartoon_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { Uint32 amask; @@ -326,20 +326,20 @@ void cartoon_switchin(magic_api * api ATTRIBUTE_UNUSED, canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, amask); } -void cartoon_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void cartoon_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { if (result_surf != NULL) SDL_FreeSurface(result_surf); } -int cartoon_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int cartoon_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 cartoon_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 cartoon_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -347,14 +347,14 @@ Uint8 cartoon_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU return 0; } -Uint8 cartoon_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 cartoon_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void cartoon_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void cartoon_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { cartoon_radius = size * 4; } diff --git a/magic/src/checkerboard.c b/magic/src/checkerboard.c index 0f252f3cd..fbb402015 100644 --- a/magic/src/checkerboard.c +++ b/magic/src/checkerboard.c @@ -76,9 +76,9 @@ Uint32 checkerboard_api_version(void) return (TP_MAGIC_API_VERSION); } -void checkerboard_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, - Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void checkerboard_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, + Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { //get the colors from API and store it in structure checkerboard_r = r; @@ -86,8 +86,7 @@ void checkerboard_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT checkerboard_b = b; } -int checkerboard_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, - Uint8 complexity_level ATTRIBUTE_UNUSED) +int checkerboard_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -97,12 +96,12 @@ int checkerboard_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, return (1); } -int checkerboard_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int checkerboard_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 1; } -SDL_Surface *checkerboard_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *checkerboard_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -111,12 +110,12 @@ SDL_Surface *checkerboard_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *checkerboard_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *checkerboard_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Checkerboard")); } -int checkerboard_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int checkerboard_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_DECORATIONS; } @@ -126,35 +125,35 @@ int checkerboard_get_order(int which ATTRIBUTE_UNUSED) return 200; } -char *checkerboard_get_description(magic_api * api ATTRIBUTE_UNUSED, +char *checkerboard_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext("Click and drag to fill the canvas with a checkerboard pattern.")); } -int checkerboard_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int checkerboard_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void checkerboard_release(magic_api * api ATTRIBUTE_UNUSED, +void checkerboard_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void checkerboard_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void checkerboard_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(checkerboard_snd); } // Interactivity functions -void checkerboard_drag(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, - int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void checkerboard_drag(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, + int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { int sz, xx, yy; Uint8 draw_start, draw_row, draw_cell; @@ -256,44 +255,43 @@ void checkerboard_drag(magic_api * api, int which ATTRIBUTE_UNUSED, api->playsound(checkerboard_snd, 128, 255); } -void checkerboard_click(magic_api * api, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void checkerboard_click(magic_api *api, int which ATTRIBUTE_UNUSED, + int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { checkerboard_start_x = x; checkerboard_start_y = y; checkerboard_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void checkerboard_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void checkerboard_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void checkerboard_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void checkerboard_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int checkerboard_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int checkerboard_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 checkerboard_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, +Uint8 checkerboard_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 checkerboard_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 checkerboard_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void checkerboard_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void checkerboard_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/clone.c b/magic/src/clone.c index de14990e3..30ed02cda 100644 --- a/magic/src/clone.c +++ b/magic/src/clone.c @@ -96,7 +96,7 @@ void clone_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Rect * update_rect); // No setup required: -int clone_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level) +int clone_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level) { char fname[1024]; @@ -124,13 +124,13 @@ Uint32 clone_api_version(void) } // We have multiple tools: -int clone_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int clone_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } // Load our icons: -SDL_Surface *clone_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *clone_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -140,13 +140,13 @@ SDL_Surface *clone_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *clone_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *clone_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Clone"))); } // Return our groups: -int clone_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int clone_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -158,7 +158,7 @@ int clone_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *clone_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *clone_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup (gettext @@ -169,7 +169,7 @@ char *clone_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT // Do the effect: -static void do_clone(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_clone(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; int yy, dx; @@ -206,8 +206,8 @@ static void do_clone(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas } // Affect the canvas on drag: -void clone_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void clone_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect *update_rect) { /* Step 3 - Actively cloning (moving the mouse) */ @@ -220,8 +220,8 @@ void clone_drag(magic_api * api, int which, SDL_Surface * canvas, clone_doit(api, which, canvas, clone_last, ox, oy, x, y, update_rect, 1); } -void clone_doit(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect, int crosshairs) +void clone_doit(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect, int crosshairs) { if (clone_state != CLONE_CLONING) return; @@ -273,8 +273,8 @@ void clone_doit(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void clone_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void clone_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (clone_state == CLONE_READY_TO_START) { @@ -302,9 +302,9 @@ void clone_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } } -void clone_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) +void clone_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect) { if (clone_state == CLONE_STARTING) { @@ -318,7 +318,7 @@ void clone_release(magic_api * api, int which ATTRIBUTE_UNUSED, } } -void done_cloning(magic_api * api, SDL_Surface * canvas, SDL_Rect * update_rect) +void done_cloning(magic_api *api, SDL_Surface *canvas, SDL_Rect *update_rect) { /* Done cloning! */ @@ -338,7 +338,7 @@ void done_cloning(magic_api * api, SDL_Surface * canvas, SDL_Rect * update_rect) api->stopsound(); } -void clone_crosshairs(magic_api * api, SDL_Surface * canvas, int x, int y) +void clone_crosshairs(magic_api *api, SDL_Surface *canvas, int x, int y) { int i; @@ -349,7 +349,7 @@ void clone_crosshairs(magic_api * api, SDL_Surface * canvas, int x, int y) } } -void clone_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void clone_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (clone_snd != NULL) Mix_FreeChunk(clone_snd); @@ -357,20 +357,20 @@ void clone_shutdown(magic_api * api ATTRIBUTE_UNUSED) Mix_FreeChunk(clone_start_snd); } -void clone_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void clone_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -int clone_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int clone_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void clone_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void clone_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { clone_last = SDL_CreateRGBSurface(0, canvas->w, canvas->h, @@ -380,7 +380,7 @@ void clone_switchin(magic_api * api ATTRIBUTE_UNUSED, clone_state = CLONE_READY_TO_START; } -void clone_switchout(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void clone_switchout(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { SDL_Rect update_rect; /* Needed to satisfy done_cloning() :-( */ @@ -390,25 +390,25 @@ void clone_switchout(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRI SDL_FreeSurface(clone_last); } -int clone_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int clone_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 clone_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 clone_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 8; } -Uint8 clone_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 clone_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void clone_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void clone_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { clone_radius = size * 8; } diff --git a/magic/src/colorsep.c b/magic/src/colorsep.c index 057ec9708..f42761c9d 100644 --- a/magic/src/colorsep.c +++ b/magic/src/colorsep.c @@ -108,7 +108,7 @@ Uint32 colorsep_api_version(void) return (TP_MAGIC_API_VERSION); } -int colorsep_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level) +int colorsep_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level) { int i; char fname[1024]; @@ -124,13 +124,13 @@ int colorsep_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin return (1); } -int colorsep_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int colorsep_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } -SDL_Surface *colorsep_get_icon(magic_api * api, int which) +SDL_Surface *colorsep_get_icon(magic_api *api, int which) { char fname[1024]; @@ -139,12 +139,12 @@ SDL_Surface *colorsep_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *colorsep_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *colorsep_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return strdup(gettext(colorsep_names[which])); } -int colorsep_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int colorsep_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } @@ -154,7 +154,7 @@ int colorsep_get_order(int which) return 700 + which; } -char *colorsep_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *colorsep_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (which == COLORSEP_TOOL_3DGLASSES && colorsep_complexity == MAGIC_COMPLEXITY_NOVICE) { @@ -166,7 +166,7 @@ char *colorsep_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int } } -int colorsep_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int colorsep_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { if (which == COLORSEP_TOOL_COLORSEP) return 1; @@ -174,12 +174,12 @@ int colorsep_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU return 0; } -int colorsep_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int colorsep_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -void colorsep_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void colorsep_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -191,8 +191,8 @@ void colorsep_shutdown(magic_api * api ATTRIBUTE_UNUSED) } void -colorsep_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +colorsep_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { api->stopsound(); @@ -205,9 +205,9 @@ colorsep_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, void -colorsep_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, - int x, int y, SDL_Rect * update_rect) +colorsep_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, + int x, int y, SDL_Rect *update_rect) { int offset_x, offset_y; @@ -231,8 +231,8 @@ colorsep_drag(magic_api * api, int which, SDL_Surface * canvas, update_rect->h = canvas->h; } -void colorsep_apply(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int offset_x, int offset_y, int preview) +void colorsep_apply(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int offset_x, int offset_y, int preview) { int xx, yy, step; Uint8 r1, g1, b1, r2, g2, b2, r, g, b; @@ -352,8 +352,8 @@ void colorsep_apply(magic_api * api, int which, SDL_Surface * canvas, } -void colorsep_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void colorsep_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int offset_x, offset_y; @@ -375,10 +375,10 @@ void colorsep_release(magic_api * api, int which, } -void colorsep_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void colorsep_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { colorsep_r_pct = (float)r / 255.0; colorsep_g_pct = (float)g / 255.0; @@ -393,17 +393,17 @@ void colorsep_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN } -void colorsep_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void colorsep_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void colorsep_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void colorsep_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -Uint8 colorsep_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +Uint8 colorsep_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (which == COLORSEP_TOOL_3DGLASSES && colorsep_complexity > MAGIC_COMPLEXITY_NOVICE) { @@ -419,15 +419,15 @@ Uint8 colorsep_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which, int m } } -Uint8 colorsep_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 colorsep_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return COLORSEP_3DGLASS_VARIATION_RED_CYAN + 1; } -void colorsep_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void colorsep_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { colorsep_3dglass_variation = (size - 1); } diff --git a/magic/src/comicdot.c b/magic/src/comicdot.c index a4217b708..3eeaa168a 100644 --- a/magic/src/comicdot.c +++ b/magic/src/comicdot.c @@ -35,13 +35,14 @@ static Mix_Chunk *comicdot_snd; static int comicdot_radius = 16; static int comicdot_r, comicdot_g, comicdot_b; -enum { +enum +{ COMICDOT_LG, COMICDOT_SM, NUM_COMICDOT_SIZES }; -SDL_Surface * comicdot_pattern[NUM_COMICDOT_SIZES]; +SDL_Surface *comicdot_pattern[NUM_COMICDOT_SIZES]; Uint32 comicdot_api_version(void); int comicdot_init(magic_api * api, Uint8 disabled_features, Uint8 complexity_level); @@ -53,17 +54,17 @@ int comicdot_get_order(int which); char *comicdot_get_description(magic_api * api, int which, int mode); void comicdot_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); + SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); void comicdot_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void comicdot_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void comicdot_shutdown(magic_api * api); void comicdot_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); + SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); int comicdot_requires_colors(magic_api * api, int which); void comicdot_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void comicdot_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas); @@ -71,14 +72,14 @@ int comicdot_modes(magic_api * api, int which); Uint8 comicdot_accepted_sizes(magic_api * api, int which, int mode); Uint8 comicdot_default_size(magic_api * api, int which, int mode); void comicdot_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, - SDL_Rect * update_rect); + SDL_Rect * update_rect); Uint32 comicdot_api_version(void) { return (TP_MAGIC_API_VERSION); } -int comicdot_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int comicdot_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; int i; @@ -103,8 +104,7 @@ int comicdot_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin size = (100 * (NUM_COMICDOT_SIZES - i)) / NUM_COMICDOT_SIZES; comicdot_pattern[i] = api->scale(comicdot_pattern[0], - (comicdot_pattern[0]->w * size) / 100, - (comicdot_pattern[0]->h * size) / 100, 1); + (comicdot_pattern[0]->w * size) / 100, (comicdot_pattern[0]->h * size) / 100, 1); if (comicdot_pattern[i] == NULL) { fprintf(stderr, "Can't scale %s (%d%%)\n", fname, size); @@ -115,12 +115,12 @@ int comicdot_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin return (1); } -int comicdot_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int comicdot_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_COMICDOT_SIZES); } -SDL_Surface *comicdot_get_icon(magic_api * api, int which) +SDL_Surface *comicdot_get_icon(magic_api *api, int which) { char fname[1024]; @@ -129,12 +129,12 @@ SDL_Surface *comicdot_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *comicdot_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *comicdot_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Comic Dots"))); } -int comicdot_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int comicdot_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -144,7 +144,7 @@ int comicdot_get_order(int which) return 1910 + which; } -char *comicdot_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *comicdot_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return (strdup(gettext("Click and drag to draw an a dot pattern on your picture"))); @@ -152,15 +152,15 @@ char *comicdot_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRI return (strdup(gettext("Click to apply a dot pattern on your entire picture"))); } -static void do_comicdot(void *ptr, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_comicdot(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; Uint8 r1, g1, b1, r, g, b, n, _; + // Uint8 nr, ng, nb; Uint32 pixel; int offx, offy; - SDL_Surface * pat; + SDL_Surface *pat; pat = comicdot_pattern[which]; @@ -186,7 +186,7 @@ static void do_comicdot(void *ptr, int which, } static void do_comicdot_circle(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -204,8 +204,8 @@ static void do_comicdot_circle(void *ptr, int which ATTRIBUTE_UNUSED, } } -void comicdot_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void comicdot_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_comicdot_circle); @@ -235,8 +235,8 @@ void comicdot_drag(magic_api * api, int which, SDL_Surface * canvas, api->playsound(comicdot_snd, 64 + ((x * 127) / canvas->w), 255); } -void comicdot_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void comicdot_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) comicdot_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -256,15 +256,15 @@ void comicdot_click(magic_api * api, int which, int mode, } } -void comicdot_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void comicdot_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { api->pausesound(); } -void comicdot_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void comicdot_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -281,38 +281,38 @@ void comicdot_shutdown(magic_api * api ATTRIBUTE_UNUSED) } } -void comicdot_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void comicdot_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { comicdot_r = r; comicdot_g = g; comicdot_b = b; } -int comicdot_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int comicdot_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void comicdot_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void comicdot_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void comicdot_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void comicdot_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { api->stopsound(); } -int comicdot_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int comicdot_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 comicdot_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 comicdot_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -320,14 +320,14 @@ Uint8 comicdot_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIB return 0; } -Uint8 comicdot_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 comicdot_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void comicdot_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void comicdot_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { comicdot_radius = size * 4; } diff --git a/magic/src/confetti.c b/magic/src/confetti.c index 4add450e1..fb1728ce1 100644 --- a/magic/src/confetti.c +++ b/magic/src/confetti.c @@ -63,9 +63,9 @@ Uint32 confetti_api_version(void) return (TP_MAGIC_API_VERSION); } -void confetti_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void confetti_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { //get the colors from API and store it in structure confetti_colors.r = r; @@ -73,7 +73,7 @@ void confetti_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN confetti_colors.b = b; } -int confetti_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int confetti_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -83,12 +83,12 @@ int confetti_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin return (1); } -int confetti_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int confetti_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 1; } -SDL_Surface *confetti_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *confetti_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -97,12 +97,12 @@ SDL_Surface *confetti_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *confetti_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *confetti_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Confetti")); } -int confetti_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int confetti_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -112,26 +112,26 @@ int confetti_get_order(int which ATTRIBUTE_UNUSED) return 1400; } -char *confetti_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *confetti_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext("Click to throw confetti!")); } -int confetti_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int confetti_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void confetti_release(magic_api * api ATTRIBUTE_UNUSED, +void confetti_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void confetti_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void confetti_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(confetti_snd); } @@ -157,7 +157,7 @@ inline char confetti_get_lesser(const char what1, const char what2) // Interactivity functions -Uint32 confetti_get_new_color(void *ptr, SDL_Surface * canvas) //this function creates new color very similar to the one choosen +Uint32 confetti_get_new_color(void *ptr, SDL_Surface *canvas) //this function creates new color very similar to the one choosen { magic_api *api = (magic_api *) ptr; @@ -179,7 +179,7 @@ Uint32 confetti_get_new_color(void *ptr, SDL_Surface * canvas) //this function static void confetti_circle(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -194,8 +194,8 @@ static void confetti_circle(void *ptr, int which ATTRIBUTE_UNUSED, api->putpixel(canvas, xx, yy, color); } -void confetti_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void confetti_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { unsigned char i; char min_x = 0, max_x = 0, min_y = 0, max_y = 0; @@ -230,8 +230,8 @@ void confetti_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, api->playsound(confetti_snd, (x * 255) / canvas->w, 255); } -void confetti_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void confetti_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { int temp; @@ -251,35 +251,35 @@ void confetti_drag(magic_api * api, int which, SDL_Surface * canvas, confetti_click(api, which, MODE_PAINT, canvas, snapshot, x, y, update_rect); } -void confetti_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void confetti_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void confetti_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void confetti_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int confetti_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int confetti_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 confetti_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 confetti_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 8; } -Uint8 confetti_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 confetti_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void confetti_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void confetti_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { CONFETTI_BRUSH_SIZE = size * 4; } diff --git a/magic/src/crescent.c b/magic/src/crescent.c index 4a17ce15a..502766f77 100644 --- a/magic/src/crescent.c +++ b/magic/src/crescent.c @@ -50,17 +50,17 @@ int crescent_get_order(int which); char *crescent_get_description(magic_api * api, int which, int mode); void crescent_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); + SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); void crescent_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void crescent_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void crescent_shutdown(magic_api * api); void crescent_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); + SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); int crescent_requires_colors(magic_api * api, int which); void crescent_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void crescent_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas); @@ -68,7 +68,7 @@ int crescent_modes(magic_api * api, int which); Uint8 crescent_accepted_sizes(magic_api * api, int which, int mode); Uint8 crescent_default_size(magic_api * api, int which, int mode); void crescent_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, - SDL_Rect * update_rect); + SDL_Rect * update_rect); void do_crescent(magic_api * api, SDL_Surface * canvas, int x, int y, SDL_Rect * update_rect, int final); @@ -78,7 +78,7 @@ Uint32 crescent_api_version(void) return (TP_MAGIC_API_VERSION); } -int crescent_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int crescent_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -88,12 +88,12 @@ int crescent_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin return (1); } -int crescent_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int crescent_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *crescent_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *crescent_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -102,12 +102,12 @@ SDL_Surface *crescent_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *crescent_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *crescent_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Crescent"))); } -int crescent_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int crescent_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -117,12 +117,12 @@ int crescent_get_order(int which ATTRIBUTE_UNUSED) return 1250; } -char *crescent_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *crescent_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag to draw a crescent shape. Use the size option to change the shape."))); } -void do_crescent(magic_api * api, SDL_Surface * canvas, int x, int y, SDL_Rect * update_rect, int final) +void do_crescent(magic_api *api, SDL_Surface *canvas, int x, int y, SDL_Rect *update_rect, int final) { float angle; int radius, neg_radius; @@ -160,8 +160,7 @@ void do_crescent(magic_api * api, SDL_Surface * canvas, int x, int y, SDL_Rect * yy = crescent_cy + yr; /* Within the canvas? */ - if (xx >= 0 && xx < canvas->w && - yy >= 0 && yy < canvas->h) + if (xx >= 0 && xx < canvas->w && yy >= 0 && yy < canvas->h) { /* Within the overall circle? */ if (api->in_circle(xr, yr, radius)) @@ -183,11 +182,11 @@ void do_crescent(magic_api * api, SDL_Surface * canvas, int x, int y, SDL_Rect * and (if dragging) the old area being removed, if it was bigger (i.e., the radius just shrunk) */ /* - update_rect->x = crescent_cx - radius - 1; - update_rect->y = crescent_cy - radius - 1; - update_rect->w = (radius * 2) + 2; - update_rect->h = (radius * 2) + 2; - */ + update_rect->x = crescent_cx - radius - 1; + update_rect->y = crescent_cy - radius - 1; + update_rect->w = (radius * 2) + 2; + update_rect->h = (radius * 2) + 2; + */ update_rect->x = 0; update_rect->y = 0; @@ -195,19 +194,19 @@ void do_crescent(magic_api * api, SDL_Surface * canvas, int x, int y, SDL_Rect * update_rect->h = canvas->h; } -void crescent_drag(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, - int x, int y, SDL_Rect * update_rect) +void crescent_drag(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, + int x, int y, SDL_Rect *update_rect) { - SDL_BlitSurface(last, NULL, canvas, NULL); // FIXME + SDL_BlitSurface(last, NULL, canvas, NULL); // FIXME do_crescent(api, canvas, x, y, update_rect, 0); api->playsound(crescent_snd, (x * 255) / canvas->w, 255); } -void crescent_click(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void crescent_click(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { crescent_cx = x; crescent_cy = y; @@ -217,61 +216,59 @@ void crescent_click(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIB api->playsound(crescent_snd, (x * 255) / canvas->w, 255); } -void crescent_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int x, - int y, SDL_Rect * update_rect) +void crescent_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { do_crescent(api, canvas, x, y, update_rect, 1); } -void crescent_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void crescent_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (crescent_snd != NULL) Mix_FreeChunk(crescent_snd); } -void crescent_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void crescent_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { crescent_color = SDL_MapRGB(canvas->format, r, g, b); } -int crescent_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int crescent_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void crescent_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void crescent_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void crescent_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void crescent_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int crescent_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int crescent_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 crescent_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 crescent_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return NUM_SIZES; } -Uint8 crescent_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 crescent_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return DEFAULT_SIZE; } -void crescent_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void crescent_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { crescent_neg_size = size; } diff --git a/magic/src/distortion.c b/magic/src/distortion.c index d467e3839..2beadb914 100644 --- a/magic/src/distortion.c +++ b/magic/src/distortion.c @@ -98,7 +98,7 @@ Uint32 distortion_api_version(void) // Initialization -int distortion_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int distortion_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -114,7 +114,7 @@ int distortion_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, U // Report our tool count -int distortion_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int distortion_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } @@ -122,7 +122,7 @@ int distortion_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) // Load icons -SDL_Surface *distortion_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *distortion_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -137,7 +137,7 @@ SDL_Surface *distortion_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) // Report our "Magic" tool names -char *distortion_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *distortion_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Distortion"))); } @@ -145,7 +145,7 @@ char *distortion_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ // Report our "Magic" tool groups -int distortion_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int distortion_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -161,15 +161,14 @@ int distortion_get_order(int which ATTRIBUTE_UNUSED) // Report our "Magic" tool descriptions -char *distortion_get_description(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *distortion_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag the mouse to cause distortion in your picture."))); } // Report whether we accept colors -int distortion_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int distortion_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } @@ -177,7 +176,7 @@ int distortion_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRI // Shut down -void distortion_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void distortion_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(snd_effect); } @@ -188,8 +187,8 @@ void distortion_shutdown(magic_api * api ATTRIBUTE_UNUSED) // Affect the canvas on click: -void distortion_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void distortion_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { distortion_drag(api, which, canvas, snapshot, x, y, x, y, update_rect); } @@ -197,8 +196,8 @@ void distortion_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, // Affect the canvas on drag: -void distortion_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void distortion_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, snapshot, ox, oy, x, y, 1, distortion_line_callback); @@ -232,19 +231,19 @@ void distortion_drag(magic_api * api, int which, SDL_Surface * canvas, // Affect the canvas on release: -void distortion_release(magic_api * api ATTRIBUTE_UNUSED, +void distortion_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void distortion_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void distortion_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } @@ -252,7 +251,7 @@ void distortion_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ // Our "callback" function static void distortion_line_callback(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -274,35 +273,35 @@ static void distortion_line_callback(void *ptr, int which ATTRIBUTE_UNUSED, } } -void distortion_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void distortion_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void distortion_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void distortion_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int distortion_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int distortion_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 distortion_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 distortion_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 8; } -Uint8 distortion_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 distortion_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void distortion_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void distortion_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { distortion_radius = size * 4; } diff --git a/magic/src/dither.c b/magic/src/dither.c index cb81d3f63..c7b2d4dd0 100644 --- a/magic/src/dither.c +++ b/magic/src/dither.c @@ -106,7 +106,7 @@ Uint32 dither_api_version(void) return (TP_MAGIC_API_VERSION); } -int dither_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int dither_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char filename[1024]; @@ -126,12 +126,12 @@ int dither_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 } -int dither_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int dither_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return NUM_TOOLS; } -SDL_Surface *dither_get_icon(magic_api * api, int which) +SDL_Surface *dither_get_icon(magic_api *api, int which) { char filename[1024]; @@ -141,13 +141,13 @@ SDL_Surface *dither_get_icon(magic_api * api, int which) } -char *dither_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *dither_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return strdup(gettext(dither_names[which])); } -int dither_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int dither_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } @@ -159,7 +159,7 @@ int dither_get_order(int which) } -char *dither_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *dither_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { if (mode == MODE_PAINT) { @@ -172,7 +172,7 @@ char *dither_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mo } -int dither_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which) +int dither_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == TOOL_DITHER_VIA_COLOR) return 1; @@ -181,25 +181,25 @@ int dither_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which) } -int dither_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int dither_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT | MODE_FULLSCREEN; } -Uint8 dither_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 dither_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return DITHER_SIZE_COUNT; } -Uint8 dither_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 dither_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return DITHER_SIZE_DEFAULT; } -void dither_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void dither_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -223,8 +223,8 @@ void dither_shutdown(magic_api * api ATTRIBUTE_UNUSED) } void -dither_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +dither_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int xx, yy; Uint8 r, g, b; @@ -268,8 +268,8 @@ dither_click(magic_api * api, int which, int mode, void -dither_drag(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int old_x, int old_y, int x, int y, SDL_Rect * update_rect) +dither_drag(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int old_x, int old_y, int x, int y, SDL_Rect *update_rect) { int dither_size; @@ -314,8 +314,8 @@ dither_drag(magic_api * api, int which, int dither_x_pos[6] = { 1, 2, -1, 0, 1, 0 }; int dither_y_pos[6] = { 0, 0, 1, 1, 1, 2 }; -void dither_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void dither_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { Uint8 r, g, b; float val, err, h, s, v; @@ -384,9 +384,9 @@ void dither_release(magic_api * api, int which, } } -void dither_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, - Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void dither_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, + Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { if (r <= 240 || g <= 240 || b <= 240) { @@ -399,15 +399,15 @@ void dither_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS } } -void dither_set_size(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * snapshot ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void dither_set_size(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *snapshot ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { dither_sizes[which] = size * DITHER_SIZE_SCALE; } -void dither_line_callback(void *pointer, int which, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y) +void dither_line_callback(void *pointer, int which, SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y) { magic_api *api = (magic_api *) pointer; int xx, yy, dither_size; @@ -445,8 +445,8 @@ void dither_line_callback(void *pointer, int which, SDL_Surface * canvas, SDL_Su } -void dither_switchin(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas) +void dither_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas) { if (dither_touched == NULL) { @@ -461,7 +461,7 @@ void dither_switchin(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE dither_black = SDL_MapRGB(canvas->format, 0, 0, 0); } -void dither_switchout(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED) +void dither_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED) { } diff --git a/magic/src/emboss.c b/magic/src/emboss.c index 3eaa00d3f..2d8bcc8a6 100644 --- a/magic/src/emboss.c +++ b/magic/src/emboss.c @@ -76,7 +76,7 @@ Uint32 emboss_api_version(void) // No setup required: -int emboss_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int emboss_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -87,13 +87,13 @@ int emboss_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 } // We have multiple tools: -int emboss_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int emboss_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *emboss_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *emboss_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -103,13 +103,13 @@ SDL_Surface *emboss_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *emboss_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *emboss_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Emboss"))); } // Return our groups: -int emboss_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int emboss_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -121,7 +121,7 @@ int emboss_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *emboss_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *emboss_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return (strdup(gettext("Click and drag the mouse to emboss the picture."))); @@ -132,7 +132,7 @@ char *emboss_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU // Do the effect (single pixel; used by do_emboss() (painted circle) // and emboss_click() when in fullscreen mode): -static void emboss_pixel(void *ptr, SDL_Surface * last, int x, int y, SDL_Surface * canvas) +static void emboss_pixel(void *ptr, SDL_Surface *last, int x, int y, SDL_Surface *canvas) { magic_api *api = (magic_api *) ptr; Uint8 r1, g1, b1, r2, g2, b2; @@ -163,7 +163,7 @@ static void emboss_pixel(void *ptr, SDL_Surface * last, int x, int y, SDL_Surfac // Do the effect (a circle around a touch point): -static void do_emboss(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_emboss(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -184,8 +184,8 @@ static void do_emboss(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canva } // Affect the canvas on drag: -void emboss_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void emboss_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_emboss); @@ -213,8 +213,8 @@ void emboss_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void emboss_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void emboss_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) { @@ -243,52 +243,52 @@ void emboss_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void emboss_release(magic_api * api ATTRIBUTE_UNUSED, +void emboss_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void emboss_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void emboss_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (emboss_snd != NULL) Mix_FreeChunk(emboss_snd); } // Record the color from Tux Paint: -void emboss_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void emboss_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int emboss_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int emboss_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void emboss_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void emboss_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void emboss_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void emboss_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int emboss_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int emboss_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 emboss_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 emboss_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -296,14 +296,14 @@ Uint8 emboss_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT return 0; } -Uint8 emboss_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 emboss_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void emboss_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void emboss_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { emboss_radius = size * 4; } diff --git a/magic/src/fade_darken.c b/magic/src/fade_darken.c index dd0dac3d8..1f2cb2830 100644 --- a/magic/src/fade_darken.c +++ b/magic/src/fade_darken.c @@ -145,7 +145,7 @@ void fade_darken_set_size(magic_api * api, int which, int mode, SDL_Surface * ca SDL_Rect * update_rect); -int fade_darken_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int fade_darken_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -165,13 +165,13 @@ Uint32 fade_darken_api_version(void) } // Multiple tools: -int fade_darken_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int fade_darken_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } // Load our icon: -SDL_Surface *fade_darken_get_icon(magic_api * api, int which) +SDL_Surface *fade_darken_get_icon(magic_api *api, int which) { char fname[1024]; @@ -181,13 +181,13 @@ SDL_Surface *fade_darken_get_icon(magic_api * api, int which) } // Return our name, localized: -char *fade_darken_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *fade_darken_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return strdup(gettext(tool_names[which])); } // Return our group (all the same): -int fade_darken_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fade_darken_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } @@ -199,12 +199,12 @@ int fade_darken_get_order(int which) } // Return our description, localized: -char *fade_darken_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *fade_darken_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return strdup(gettext(tool_descriptions[which][mode - 1])); } -static void do_fade_darken(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_fade_darken(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { Uint8 r, g, b; magic_api *api = (magic_api *) ptr; @@ -271,7 +271,7 @@ static void do_fade_darken(void *ptr, int which, SDL_Surface * canvas, SDL_Surfa // Callback that does the fade_darken color effect on a circle centered around x,y -static void do_fade_darken_paint(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_fade_darken_paint(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { int xx, yy; magic_api *api = (magic_api *) ptr; @@ -289,8 +289,8 @@ static void do_fade_darken_paint(void *ptr, int which, SDL_Surface * canvas, SDL } // Ask Tux Paint to call our 'do_fade_darken_paint()' callback over a line -void fade_darken_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void fade_darken_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { SDL_LockSurface(last); SDL_LockSurface(canvas); @@ -325,8 +325,8 @@ void fade_darken_drag(magic_api * api, int which, SDL_Surface * canvas, // Ask Tux Paint to call our 'do_fade_darken_paint()' callback at a single point, // or 'do_fade_darken()' on the entire image -void fade_darken_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void fade_darken_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) fade_darken_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -348,17 +348,17 @@ void fade_darken_click(magic_api * api, int which, int mode, } // Release -void fade_darken_release(magic_api * api ATTRIBUTE_UNUSED, +void fade_darken_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void fade_darken_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void fade_darken_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (snd_effects[0] != NULL) Mix_FreeChunk(snd_effects[0]); @@ -366,9 +366,9 @@ void fade_darken_shutdown(magic_api * api ATTRIBUTE_UNUSED) Mix_FreeChunk(snd_effects[1]); } -void fade_darken_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fade_darken_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { float tmp; @@ -376,7 +376,7 @@ void fade_darken_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surf } // We don't use colors -int fade_darken_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fade_darken_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { if (which == TOOL_REMOVE || which == TOOL_KEEP) return 1; @@ -384,24 +384,23 @@ int fade_darken_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTR return 0; } -void fade_darken_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void fade_darken_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void fade_darken_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void fade_darken_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int fade_darken_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fade_darken_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 fade_darken_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED) +Uint8 fade_darken_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { if (mode == MODE_PAINT) return 8; @@ -409,14 +408,14 @@ Uint8 fade_darken_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATT return 0; } -Uint8 fade_darken_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fade_darken_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void fade_darken_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fade_darken_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { fade_darken_radius = size * 4; } diff --git a/magic/src/fisheye.c b/magic/src/fisheye.c index 0c826fd59..876a1ad15 100644 --- a/magic/src/fisheye.c +++ b/magic/src/fisheye.c @@ -76,14 +76,14 @@ Uint32 fisheye_api_version(void) return (TP_MAGIC_API_VERSION); } -void fisheye_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void fisheye_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -int fisheye_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int fisheye_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -93,12 +93,12 @@ int fisheye_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint return (1); } -int fisheye_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int fisheye_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 1; } -SDL_Surface *fisheye_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *fisheye_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -107,12 +107,12 @@ SDL_Surface *fisheye_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *fisheye_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *fisheye_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Fisheye")); } -int fisheye_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fisheye_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -122,34 +122,34 @@ int fisheye_get_order(int which ATTRIBUTE_UNUSED) return 400; } -char *fisheye_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *fisheye_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext("Click on part of your picture to create a fisheye effect.")); } -int fisheye_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fisheye_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void fisheye_release(magic_api * api ATTRIBUTE_UNUSED, +void fisheye_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void fisheye_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void fisheye_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(fisheye_snd); } // do-fisheye -void fisheye_draw(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) +void fisheye_draw(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; SDL_Surface *oryg, *temp_src = NULL, *temp_dest = NULL, *output; @@ -283,8 +283,8 @@ void fisheye_draw(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, api->playsound(fisheye_snd, (x * 255) / canvas->w, 255); } -void fisheye_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void fisheye_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line(api, which, canvas, snapshot, ox, oy, x, y, 1, fisheye_draw); @@ -294,45 +294,45 @@ void fisheye_drag(magic_api * api, int which, SDL_Surface * canvas, update_rect->h = max(oy, y) - update_rect->y + (fisheye_radius / 2); } -void fisheye_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void fisheye_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { last_x = -fisheye_radius; /* A value that will be beyond any clicked position */ last_y = -fisheye_radius; fisheye_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void fisheye_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void fisheye_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void fisheye_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void fisheye_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int fisheye_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fisheye_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 fisheye_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fisheye_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 5; // FIXME } -Uint8 fisheye_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fisheye_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; // FIXME } -void fisheye_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fisheye_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { fisheye_radius = size * 40; } diff --git a/magic/src/flower.c b/magic/src/flower.c index 38ac7cacc..26236087a 100644 --- a/magic/src/flower.c +++ b/magic/src/flower.c @@ -115,7 +115,7 @@ Uint32 flower_api_version(void) // No setup required: -int flower_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int flower_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; SDL_Surface *tmp_surf; @@ -180,13 +180,13 @@ int flower_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 } // We have multiple tools: -int flower_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int flower_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *flower_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *flower_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -196,13 +196,13 @@ SDL_Surface *flower_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *flower_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *flower_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Flower"))); } // Return our groups: -int flower_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int flower_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_ARTISTIC; } @@ -214,15 +214,15 @@ int flower_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *flower_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *flower_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext_noop("Click and drag to draw a flower stalk. Let go to finish the flower."))); } // Affect the canvas on drag: -static void flower_predrag(magic_api * api ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y) +static void flower_predrag(magic_api *api ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y) { if (x < flower_min_x) flower_min_x = x; @@ -255,8 +255,8 @@ static void flower_predrag(magic_api * api ATTRIBUTE_UNUSED, } } -void flower_drag(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void flower_drag(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { flower_predrag(api, canvas, last, ox, oy, x, y); @@ -280,8 +280,8 @@ void flower_drag(magic_api * api, int which ATTRIBUTE_UNUSED, } // Affect the canvas on click: -void flower_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void flower_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { flower_min_x = x; flower_max_x = x; @@ -297,8 +297,8 @@ void flower_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } // Affect the canvas on release: -void flower_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void flower_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { /* Don't let flower be too low compared to base: */ @@ -334,7 +334,7 @@ void flower_release(magic_api * api, int which ATTRIBUTE_UNUSED, } -static void flower_drawflower(magic_api * api ATTRIBUTE_UNUSED, SDL_Surface * canvas, int x, int y) +static void flower_drawflower(magic_api *api ATTRIBUTE_UNUSED, SDL_Surface *canvas, int x, int y) { SDL_Rect dest; @@ -347,7 +347,7 @@ static void flower_drawflower(magic_api * api ATTRIBUTE_UNUSED, SDL_Surface * ca SDL_BlitSurface(flower_petals_colorized, NULL, canvas, &dest); } -static void flower_drawbase(magic_api * api ATTRIBUTE_UNUSED, SDL_Surface * canvas) +static void flower_drawbase(magic_api *api ATTRIBUTE_UNUSED, SDL_Surface *canvas) { SDL_Rect dest; @@ -360,8 +360,8 @@ static void flower_drawbase(magic_api * api ATTRIBUTE_UNUSED, SDL_Surface * canv SDL_BlitSurface(flower_base, NULL, canvas, &dest); } -static void flower_drawstalk(magic_api * api ATTRIBUTE_UNUSED, - SDL_Surface * canvas, int top_x, int top_y, +static void flower_drawstalk(magic_api *api ATTRIBUTE_UNUSED, + SDL_Surface *canvas, int top_x, int top_y, int minx, int maxx, int bottom_x, int bottom_y, int final) { Point2D control_points[4]; @@ -541,7 +541,7 @@ static void flower_drawstalk(magic_api * api ATTRIBUTE_UNUSED, free(curve); } -void flower_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void flower_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (flower_click_snd != NULL) Mix_FreeChunk(flower_click_snd); @@ -567,9 +567,9 @@ void flower_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void flower_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void flower_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { flower_r = r; flower_g = g; @@ -579,7 +579,7 @@ void flower_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * } // Use colors: -int flower_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int flower_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } @@ -599,7 +599,7 @@ cp[3] is the end point, or P3 in the above diagram t is the parameter value, 0 <= t <= 1 */ -static Point2D flower_PointOnCubicBezier(Point2D * cp, float t) +static Point2D flower_PointOnCubicBezier(Point2D *cp, float t) { float ax, bx, cx; float ay, by, cy; @@ -634,7 +634,7 @@ static Point2D flower_PointOnCubicBezier(Point2D * cp, float t) */ -static void flower_ComputeBezier(Point2D * cp, int numberOfPoints, Point2D * curve) +static void flower_ComputeBezier(Point2D *cp, int numberOfPoints, Point2D *curve) { float dt; int i; @@ -646,7 +646,7 @@ static void flower_ComputeBezier(Point2D * cp, int numberOfPoints, Point2D * cur } -static void flower_colorize_petals(magic_api * api) +static void flower_colorize_petals(magic_api *api) { Uint32 amask; int x, y; @@ -695,34 +695,34 @@ static void flower_colorize_petals(magic_api * api) SDL_UnlockSurface(flower_petals); } -void flower_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void flower_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void flower_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void flower_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int flower_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int flower_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT_WITH_PREVIEW); } -Uint8 flower_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 flower_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return NUM_SIZES; } -Uint8 flower_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 flower_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return DEFAULT_SIZE; } -void flower_set_size(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void flower_set_size(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { int scale, width, height; diff --git a/magic/src/foam.c b/magic/src/foam.c index faa23e48d..943a3cc76 100644 --- a/magic/src/foam.c +++ b/magic/src/foam.c @@ -78,7 +78,7 @@ Uint32 foam_api_version(void) // No setup required: -int foam_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int foam_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; SDL_Surface *foam_data; @@ -111,13 +111,13 @@ int foam_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 c } // We have multiple tools: -int foam_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int foam_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *foam_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *foam_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -127,13 +127,13 @@ SDL_Surface *foam_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *foam_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *foam_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Foam"))); } // Return our groups -int foam_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int foam_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -145,7 +145,7 @@ int foam_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *foam_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *foam_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag the mouse to cover an area with foamy bubbles."))); } @@ -153,7 +153,7 @@ char *foam_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE // Do the effect: static void do_foam(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy, nx, ny; @@ -179,8 +179,8 @@ static void do_foam(void *ptr, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void foam_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void foam_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_foam); @@ -212,9 +212,9 @@ void foam_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void foam_click(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) +void foam_click(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect) { int i; @@ -256,15 +256,15 @@ static int foam_mask_test(int r, int x, int y) } // Affect the canvas on release: -void foam_release(magic_api * api ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) +void foam_release(magic_api *api ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect) { api->stopsound(); foam_release_worker(canvas, last, update_rect); } -void foam_release_worker(SDL_Surface * canvas, SDL_Surface * last, SDL_Rect * update_rect) +void foam_release_worker(SDL_Surface *canvas, SDL_Surface *last, SDL_Rect *update_rect) { int xx, yy; int changes, max_iters; @@ -442,7 +442,7 @@ void foam_release_worker(SDL_Surface * canvas, SDL_Surface * last, SDL_Rect * up } // No setup happened: -void foam_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void foam_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (foam_snd != NULL) Mix_FreeChunk(foam_snd); @@ -461,9 +461,9 @@ void foam_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void foam_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void foam_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { foam_r = r; foam_g = g; @@ -471,39 +471,39 @@ void foam_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED } // Use colors: -int foam_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int foam_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; /* FIXME: Would be nice to tint the bubbles */ } -void foam_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void foam_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void foam_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void foam_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int foam_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int foam_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 foam_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 foam_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 foam_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 foam_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void foam_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void foam_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/fold.c b/magic/src/fold.c index de47ff547..b9f4d7d64 100644 --- a/magic/src/fold.c +++ b/magic/src/fold.c @@ -77,9 +77,9 @@ Uint32 fold_api_version(void) return (TP_MAGIC_API_VERSION); } -void fold_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fold_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { //get the colors from API and store it in structure fold_r = r; @@ -87,7 +87,7 @@ void fold_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED fold_b = b; } -int fold_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int fold_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -97,12 +97,12 @@ int fold_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 c return (1); } -int fold_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int fold_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 1; } -SDL_Surface *fold_get_icon(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +SDL_Surface *fold_get_icon(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -111,12 +111,12 @@ SDL_Surface *fold_get_icon(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE return (IMG_Load(fname)); } -char *fold_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *fold_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (gettext("Fold")); } -int fold_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fold_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -126,18 +126,18 @@ int fold_get_order(int which ATTRIBUTE_UNUSED) return 700; } -char *fold_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *fold_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext("Choose a background color and click to turn the corner of the page over.")); } -int fold_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fold_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } //selected color will be a "backpage" color -static void fold_shadow(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * temp, int x, int y) +static void fold_shadow(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, SDL_Surface *temp, int x, int y) { magic_api *api = (magic_api *) ptr; Uint8 r, g, b, a; @@ -150,8 +150,8 @@ static void fold_shadow(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * can 0), max(b - 160 + fold_shadow_value * 4, 0), a)); } -void fold_draw(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fold_draw(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { float right_step_x, right_step_y, left_step_x, left_step_y; float dist_x, dist_y; @@ -244,7 +244,7 @@ void fold_draw(magic_api * api, int which, } -SDL_Surface *rotate(magic_api * api, SDL_Surface * canvas, int angle) +SDL_Surface *rotate(magic_api *api, SDL_Surface *canvas, int angle) { SDL_Surface *temp; int x, y; @@ -294,7 +294,7 @@ SDL_Surface *rotate(magic_api * api, SDL_Surface * canvas, int angle) return temp; } -void translate_coords(SDL_Surface * canvas, int angle) +void translate_coords(SDL_Surface *canvas, int angle) { int a, b; @@ -326,7 +326,7 @@ void translate_coords(SDL_Surface * canvas, int angle) } } -void translate_xy(SDL_Surface * canvas, int x, int y, int *a, int *b, int rotation) +void translate_xy(SDL_Surface *canvas, int x, int y, int *a, int *b, int rotation) { switch (rotation) { @@ -345,8 +345,8 @@ void translate_xy(SDL_Surface * canvas, int x, int y, int *a, int *b, int rotati } } -void fold_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void fold_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int a, b; SDL_Surface *temp, *temp2; @@ -401,7 +401,7 @@ void fold_release(magic_api * api, int which, api->playsound(fold_snd, (x * 255) / canvas->w, 255); } -void fold_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void fold_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(fold_snd); SDL_FreeSurface(fold_surface_dst); @@ -410,7 +410,7 @@ void fold_shutdown(magic_api * api ATTRIBUTE_UNUSED) // Interactivity functions -inline Uint8 fold_what_corner(int x, int y, SDL_Surface * canvas) +inline Uint8 fold_what_corner(int x, int y, SDL_Surface *canvas) { if (x >= canvas->w / 2) { @@ -429,8 +429,7 @@ inline Uint8 fold_what_corner(int x, int y, SDL_Surface * canvas) } -static void fold_print_line(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void fold_print_line(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -438,7 +437,7 @@ static void fold_print_line(void *ptr, int which ATTRIBUTE_UNUSED, } static void fold_print_dark_line(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -446,15 +445,15 @@ static void fold_print_dark_line(void *ptr, int which ATTRIBUTE_UNUSED, } static void fold_erase(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; api->putpixel(canvas, x, y, SDL_MapRGB(canvas->format, fold_r, fold_g, fold_b)); } -void fold_click(magic_api * ptr, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void fold_click(magic_api *ptr, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { magic_api *api = (magic_api *) ptr; @@ -482,9 +481,9 @@ void fold_click(magic_api * ptr, int which, int mode ATTRIBUTE_UNUSED, fold_drag(api, which, canvas, snapshot, x, y, x, y, update_rect); } -void fold_preview(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox ATTRIBUTE_UNUSED, - int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void fold_preview(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, + int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { int middle_point_x; int middle_point_y; @@ -548,8 +547,8 @@ void fold_preview(magic_api * api, int which, SDL_Surface * canvas, update_rect->h = canvas->h; } -void fold_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void fold_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { // Avoid division by zero when calculating the preview x = clamp(2, x, canvas->w - 2); @@ -557,34 +556,34 @@ void fold_drag(magic_api * api, int which, SDL_Surface * canvas, fold_preview(api, which, canvas, snapshot, ox, oy, x, y, update_rect); } -void fold_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void fold_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void fold_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void fold_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int fold_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fold_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT_WITH_PREVIEW); } -Uint8 fold_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fold_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 fold_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fold_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void fold_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fold_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/fractal.c b/magic/src/fractal.c index 4d5883111..06a7944eb 100644 --- a/magic/src/fractal.c +++ b/magic/src/fractal.c @@ -33,7 +33,8 @@ #define NUM_TOOLS 4 -typedef struct fract_opt_s { +typedef struct fract_opt_s +{ int angle; float scale; } fract_opt_t; @@ -46,7 +47,8 @@ fract_opt_t fract_opt[NUM_TOOLS] = { }; -typedef struct pt_s { +typedef struct pt_s +{ int x, y; } pt_t; @@ -74,17 +76,17 @@ int fractal_get_order(int which); char *fractal_get_description(magic_api * api, int which, int mode); void fractal_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); + SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); void fractal_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void fractal_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void fractal_shutdown(magic_api * api); void fractal_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); + SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); int fractal_requires_colors(magic_api * api, int which); void fractal_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void fractal_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas); @@ -92,15 +94,16 @@ int fractal_modes(magic_api * api, int which); Uint8 fractal_accepted_sizes(magic_api * api, int which, int mode); Uint8 fractal_default_size(magic_api * api, int which, int mode); void fractal_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, - SDL_Rect * update_rect); -void do_fractal(magic_api * api, int which, SDL_Surface * canvas, int iter, float cx, float cy, float angle, float scale, float opacity, int final); + SDL_Rect * update_rect); +void do_fractal(magic_api * api, int which, SDL_Surface * canvas, int iter, float cx, float cy, float angle, + float scale, float opacity, int final); Uint32 fractal_api_version(void) { return (TP_MAGIC_API_VERSION); } -int fractal_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int fractal_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -110,12 +113,12 @@ int fractal_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint return (1); } -int fractal_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int fractal_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } -SDL_Surface *fractal_get_icon(magic_api * api, int ATTRIBUTE_UNUSED which) +SDL_Surface *fractal_get_icon(magic_api *api, int ATTRIBUTE_UNUSED which) { char fname[1024]; @@ -124,7 +127,7 @@ SDL_Surface *fractal_get_icon(magic_api * api, int ATTRIBUTE_UNUSED which) return (IMG_Load(fname)); } -char *fractal_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *fractal_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { char tmp[128]; @@ -132,7 +135,7 @@ char *fractal_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) return strdup(tmp); } -int fractal_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fractal_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -142,7 +145,7 @@ int fractal_get_order(int which) return 10001 + which; } -char *fractal_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *fractal_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { char tmp[512]; @@ -150,23 +153,29 @@ char *fractal_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int m { if (fract_opt[which].angle != 0) { - snprintf(tmp, sizeof(tmp), gettext("Click and drag to sketch a shape. It will repeat, %1$s %2$d%% and rotating %3$d degrees."), (fract_opt[which].scale > 1.0 ? gettext("scaling up") : gettext("scaling down")), (int) (fract_opt[which].scale * 100), fract_opt[which].angle); + snprintf(tmp, sizeof(tmp), + gettext("Click and drag to sketch a shape. It will repeat, %1$s %2$d%% and rotating %3$d degrees."), + (fract_opt[which].scale > 1.0 ? gettext("scaling up") : gettext("scaling down")), + (int)(fract_opt[which].scale * 100), fract_opt[which].angle); } else { - snprintf(tmp, sizeof(tmp), gettext("Click and drag to sketch a shape. It will repeat, %1$s %2$d%%."), (fract_opt[which].scale > 1.0 ? gettext("scaling up") : gettext("scaling down")), (int) (fract_opt[which].scale * 100)); + snprintf(tmp, sizeof(tmp), gettext("Click and drag to sketch a shape. It will repeat, %1$s %2$d%%."), + (fract_opt[which].scale > 1.0 ? gettext("scaling up") : gettext("scaling down")), + (int)(fract_opt[which].scale * 100)); } } else { - snprintf(tmp, sizeof(tmp), gettext("Click and drag to sketch a shape. It will repeat, rotating %d degrees."), fract_opt[which].angle); + snprintf(tmp, sizeof(tmp), gettext("Click and drag to sketch a shape. It will repeat, rotating %d degrees."), + fract_opt[which].angle); } return (strdup(tmp)); } static void do_fractal_circle(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -180,9 +189,9 @@ static void do_fractal_circle(void *ptr, int which ATTRIBUTE_UNUSED, if (fractal_opacity_cur < 1.0) { SDL_GetRGB(api->getpixel(canvas, xx + x, yy + y), canvas->format, &r, &g, &b); - r = (Uint8) (((float) r * (1.0 - fractal_opacity_cur)) + ((float) fractal_r * fractal_opacity_cur)); - g = (Uint8) (((float) g * (1.0 - fractal_opacity_cur)) + ((float) fractal_g * fractal_opacity_cur)); - b = (Uint8) (((float) b * (1.0 - fractal_opacity_cur)) + ((float) fractal_b * fractal_opacity_cur)); + r = (Uint8) (((float)r * (1.0 - fractal_opacity_cur)) + ((float)fractal_r * fractal_opacity_cur)); + g = (Uint8) (((float)g * (1.0 - fractal_opacity_cur)) + ((float)fractal_g * fractal_opacity_cur)); + b = (Uint8) (((float)b * (1.0 - fractal_opacity_cur)) + ((float)fractal_b * fractal_opacity_cur)); } else { @@ -197,7 +206,8 @@ static void do_fractal_circle(void *ptr, int which ATTRIBUTE_UNUSED, } } -void do_fractal(magic_api * api, int which, SDL_Surface * canvas, int iter, float cx, float cy, float angle, float scale, float opacity, int final) +void do_fractal(magic_api *api, int which, SDL_Surface *canvas, int iter, float cx, float cy, float angle, float scale, + float opacity, int final) { int i; float x1, y1, x2, y2, nx, ny; @@ -206,11 +216,12 @@ void do_fractal(magic_api * api, int which, SDL_Surface * canvas, int iter, floa co = cosf(angle); si = sinf(angle); - for (i = 0; i < num_pts - 1; i++) { - x1 = (float) (pts[i].x); - y1 = (float) (pts[i].y); - x2 = (float) (pts[i + 1].x); - y2 = (float) (pts[i + 1].y); + for (i = 0; i < num_pts - 1; i++) + { + x1 = (float)(pts[i].x); + y1 = (float)(pts[i].y); + x2 = (float)(pts[i + 1].x); + y2 = (float)(pts[i + 1].y); /* Translate point relative to (0,0) origin */ x1 -= cx; @@ -243,19 +254,23 @@ void do_fractal(magic_api * api, int which, SDL_Surface * canvas, int iter, floa fractal_radius_cur = (iter / 2) + 1; fractal_opacity_cur = opacity; - api->line((void *)api, which, canvas, NULL, (int) x1, (int) y1, (int) x2, (int) y2, (final ? 1 : 10), do_fractal_circle); + api->line((void *)api, which, canvas, NULL, (int)x1, (int)y1, (int)x2, (int)y2, (final ? 1 : 10), + do_fractal_circle); if (final && ((i % ((num_pts / 3) + 1)) == 1) && (iter > 1)) { - do_fractal(api, which, canvas, iter - 1, x2, y2, angle + ((float) fract_opt[which].angle / 180.0 * M_PI), scale * fract_opt[which].scale, opacity * 0.5, final); + do_fractal(api, which, canvas, iter - 1, x2, y2, angle + ((float)fract_opt[which].angle / 180.0 * M_PI), + scale * fract_opt[which].scale, opacity * 0.5, final); } } } -void fractal_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void fractal_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, + SDL_Rect *update_rect) { - if (num_pts < MAX_PTS) { + if (num_pts < MAX_PTS) + { pts[num_pts].x = x; pts[num_pts].y = y; num_pts++; @@ -273,22 +288,21 @@ void fractal_drag(magic_api * api, int which, SDL_Surface * canvas, api->playsound(fractal_snd, (x * 255) / canvas->w, 255); } -void fractal_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void fractal_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { pts[0].x = x; pts[0].y = y; num_pts = 1; - fractal_click_x = (float) x; - fractal_click_y = (float) y; + fractal_click_x = (float)x; + fractal_click_y = (float)y; fractal_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void fractal_release(magic_api * api, int which, - SDL_Surface * canvas, - SDL_Surface * last, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) +void fractal_release(magic_api *api, int which, + SDL_Surface *canvas, + SDL_Surface *last, int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect) { SDL_BlitSurface(last, NULL, canvas, NULL); @@ -302,54 +316,55 @@ void fractal_release(magic_api * api, int which, api->stopsound(); } -void fractal_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void fractal_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (fractal_snd != NULL) Mix_FreeChunk(fractal_snd); } -void fractal_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fractal_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { fractal_r = r; fractal_g = g; fractal_b = b; } -int fractal_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fractal_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void fractal_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void fractal_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void fractal_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void fractal_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int fractal_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fractal_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 fractal_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fractal_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -Uint8 fractal_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fractal_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void fractal_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fractal_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { fractal_radius = size + 1; } diff --git a/magic/src/fretwork.c b/magic/src/fretwork.c index fa85824f6..caa33ab9f 100644 --- a/magic/src/fretwork.c +++ b/magic/src/fretwork.c @@ -97,14 +97,14 @@ Uint32 fretwork_api_version(void) return (TP_MAGIC_API_VERSION); } -int fretwork_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fretwork_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -void fretwork_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fretwork_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { fretwork_r = r; fretwork_g = g; @@ -116,7 +116,7 @@ void fretwork_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface } /* Adapted from flower.c */ -static void fretwork_colorize(magic_api * api, SDL_Surface * dest, SDL_Surface * src) +static void fretwork_colorize(magic_api *api, SDL_Surface *dest, SDL_Surface *src) { int x, y; Uint8 r, g, b, a; @@ -139,7 +139,7 @@ static void fretwork_colorize(magic_api * api, SDL_Surface * dest, SDL_Surface * } -int fretwork_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int fretwork_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; Uint8 i; //is always < 4, so Uint8 seems to be a good idea @@ -193,12 +193,12 @@ int fretwork_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin return (1); } -int fretwork_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int fretwork_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 1; } -SDL_Surface *fretwork_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *fretwork_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -207,7 +207,7 @@ SDL_Surface *fretwork_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -int fretwork_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fretwork_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -217,12 +217,12 @@ int fretwork_get_order(int which ATTRIBUTE_UNUSED) return 2100; } -char *fretwork_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *fretwork_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Fretwork")); } -char *fretwork_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *fretwork_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return strdup(gettext("Click and drag to draw repetitive patterns.")); @@ -230,20 +230,20 @@ char *fretwork_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRI return strdup(gettext("Click to surround your picture with repetitive patterns.")); } -int fretwork_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int fretwork_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void fretwork_release(magic_api * api ATTRIBUTE_UNUSED, +void fretwork_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void fretwork_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void fretwork_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Uint8 i; @@ -266,9 +266,9 @@ void fretwork_shutdown(magic_api * api ATTRIBUTE_UNUSED) free(fretwork_status_of_segments); } -void fretwork_switchin(magic_api * api ATTRIBUTE_UNUSED, +void fretwork_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED) { //we've to compute the quantity of segments in each direction @@ -285,9 +285,9 @@ void fretwork_switchin(magic_api * api ATTRIBUTE_UNUSED, } -void fretwork_switchout(magic_api * api ATTRIBUTE_UNUSED, +void fretwork_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * snapshot ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *snapshot ATTRIBUTE_UNUSED) { free(fretwork_status_of_segments); fretwork_status_of_segments = NULL; @@ -319,7 +319,7 @@ inline unsigned int fretwork_get_segment(int x, int y) return (yy - 1) * fretwork_segments_x + xx; } -inline void fretwork_extract_coords_from_segment(unsigned int segment, POINT_TYPE * x, POINT_TYPE * y) +inline void fretwork_extract_coords_from_segment(unsigned int segment, POINT_TYPE *x, POINT_TYPE *y) { *x = ((segment % fretwork_segments_x) - 1) * img_w; //useful to set update_rect as small as possible *y = (int)(segment / fretwork_segments_x) * img_h; @@ -336,7 +336,7 @@ inline void fretwork_extract_coords_from_segment(unsigned int segment, POINT_TYP /* api->putpixel(dest, x, y, api->getpixel(src, x, src->h-y)); */ /* } */ -static void fretwork_flip_flop(void *ptr, SDL_Surface * dest, SDL_Surface * src) +static void fretwork_flip_flop(void *ptr, SDL_Surface *dest, SDL_Surface *src) { magic_api *api = (magic_api *) ptr; POINT_TYPE x, y; @@ -346,7 +346,7 @@ static void fretwork_flip_flop(void *ptr, SDL_Surface * dest, SDL_Surface * src) api->putpixel(dest, dest->w - 1 - x, dest->h - 1 - y, api->getpixel(src, x, y)); } -static void fretwork_rotate(void *ptr, SDL_Surface * dest, SDL_Surface * src, _Bool direction) +static void fretwork_rotate(void *ptr, SDL_Surface *dest, SDL_Surface *src, _Bool direction) //src and dest must have same size { magic_api *api = (magic_api *) ptr; @@ -368,8 +368,8 @@ static void fretwork_rotate(void *ptr, SDL_Surface * dest, SDL_Surface * src, _B } -void fretwork_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void fretwork_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int left_x, right_x, top_y, bottom_y; @@ -520,8 +520,8 @@ static Uint8 fretwork_select_image(Uint16 segment) static void fretwork_draw(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y ATTRIBUTE_UNUSED, unsigned int segment) + SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y ATTRIBUTE_UNUSED, unsigned int segment) { magic_api *api = (magic_api *) ptr; SDL_Surface *result, *temp; @@ -624,7 +624,7 @@ static void fretwork_draw(void *ptr, int which ATTRIBUTE_UNUSED, } -static void fretwork_draw_wrapper(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void fretwork_draw_wrapper(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { fretwork_segment_modified = fretwork_get_segment(x, y); @@ -649,8 +649,8 @@ static void fretwork_draw_wrapper(void *ptr, int which, SDL_Surface * canvas, SD fretwork_segment_modified_last = fretwork_segment_modified; } -void fretwork_drag(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void fretwork_drag(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { int start_x, end_x, start_y, end_y, segment_start, segment_end, w, h; @@ -678,18 +678,18 @@ void fretwork_drag(magic_api * api, int which, } } -Uint8 fretwork_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fretwork_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 fretwork_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 fretwork_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void fretwork_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void fretwork_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/glasstile.c b/magic/src/glasstile.c index 0a58da7b8..529622a87 100644 --- a/magic/src/glasstile.c +++ b/magic/src/glasstile.c @@ -78,7 +78,7 @@ static int **glasstile_hit; static int glasstile_hit_xsize; static int glasstile_hit_ysize; -int glasstile_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED /* FIXME */ , +int glasstile_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED /* FIXME */ , Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -92,13 +92,13 @@ int glasstile_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED /* return (1); } -int glasstile_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int glasstile_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *glasstile_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *glasstile_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -108,13 +108,13 @@ SDL_Surface *glasstile_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *glasstile_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *glasstile_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Glass Tile"))); } // Return our groups -int glasstile_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int glasstile_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -126,7 +126,7 @@ int glasstile_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *glasstile_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *glasstile_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return (strdup(gettext("Click and drag the mouse to put glass tile over your picture."))); @@ -136,7 +136,7 @@ char *glasstile_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTR // Do the effect: -static void do_glasstile(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_glasstile(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy, xl, xr, yt, yb; @@ -218,8 +218,8 @@ static void do_glasstile(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * ca } // Affect the canvas on drag: -void glasstile_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void glasstile_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_glasstile); @@ -253,8 +253,8 @@ void glasstile_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void glasstile_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void glasstile_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { int xx, yy; @@ -291,16 +291,16 @@ void glasstile_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void glasstile_release(magic_api * api ATTRIBUTE_UNUSED, +void glasstile_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void glasstile_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void glasstile_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int y; @@ -319,48 +319,48 @@ void glasstile_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void glasstile_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void glasstile_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int glasstile_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int glasstile_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void glasstile_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void glasstile_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void glasstile_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void glasstile_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int glasstile_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int glasstile_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 glasstile_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 glasstile_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { /* TODO - We should support sizing! -bjk 2023.04.22 */ return 0; } -Uint8 glasstile_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 glasstile_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void glasstile_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void glasstile_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/googlyeyes.c b/magic/src/googlyeyes.c index d39e64dba..7985d9e8e 100644 --- a/magic/src/googlyeyes.c +++ b/magic/src/googlyeyes.c @@ -74,7 +74,7 @@ Uint32 googlyeyes_api_version(void) return (TP_MAGIC_API_VERSION); } -int googlyeyes_init(magic_api * api, Uint8 disabled_features, Uint8 complexity_level ATTRIBUTE_UNUSED) +int googlyeyes_init(magic_api *api, Uint8 disabled_features, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; int i; @@ -179,7 +179,7 @@ int googlyeyes_init(magic_api * api, Uint8 disabled_features, Uint8 complexity_l return (1); } -int googlyeyes_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int googlyeyes_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { if (googlyeyes_limited) { @@ -192,7 +192,7 @@ int googlyeyes_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) } -SDL_Surface *googlyeyes_get_icon(magic_api * api, int which) +SDL_Surface *googlyeyes_get_icon(magic_api *api, int which) { char fname[1024]; @@ -201,12 +201,12 @@ SDL_Surface *googlyeyes_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *googlyeyes_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *googlyeyes_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Googly Eyes")); } -int googlyeyes_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int googlyeyes_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_ARTISTIC; } @@ -216,8 +216,7 @@ int googlyeyes_get_order(int which) return 200 + which; } -char *googlyeyes_get_description(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *googlyeyes_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { if (googlyeyes_limited) { @@ -229,17 +228,17 @@ char *googlyeyes_get_description(magic_api * api ATTRIBUTE_UNUSED, } } -int googlyeyes_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int googlyeyes_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -int googlyeyes_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int googlyeyes_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 googlyeyes_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 googlyeyes_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { if (googlyeyes_limited) { @@ -251,12 +250,12 @@ Uint8 googlyeyes_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTR } } -Uint8 googlyeyes_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 googlyeyes_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return NUM_SCALEABLE_SIZES; } -void googlyeyes_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void googlyeyes_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -282,8 +281,8 @@ void googlyeyes_shutdown(magic_api * api ATTRIBUTE_UNUSED) void -googlyeyes_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +googlyeyes_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int img; @@ -312,9 +311,9 @@ googlyeyes_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, void -googlyeyes_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox ATTRIBUTE_UNUSED, - int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +googlyeyes_drag(magic_api *api ATTRIBUTE_UNUSED, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, + int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { SDL_Rect dest; int max_radius; @@ -376,34 +375,34 @@ googlyeyes_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canva void -googlyeyes_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +googlyeyes_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void googlyeyes_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void googlyeyes_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void googlyeyes_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 sz, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void googlyeyes_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { googlyeyes_size = (NUM_SCALEABLE_SIZES - sz) + 1; } -void googlyeyes_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void googlyeyes_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void googlyeyes_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void googlyeyes_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } diff --git a/magic/src/grass.c b/magic/src/grass.c index 907c00628..fee56d3e8 100644 --- a/magic/src/grass.c +++ b/magic/src/grass.c @@ -70,7 +70,7 @@ void grass_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Rect * update_rect); // No setup required: -int grass_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int grass_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -91,13 +91,13 @@ Uint32 grass_api_version(void) } // We have multiple tools: -int grass_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int grass_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *grass_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *grass_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -107,13 +107,13 @@ SDL_Surface *grass_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *grass_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *grass_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Grass"))); } // Return our groups: -int grass_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int grass_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -125,15 +125,15 @@ int grass_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *grass_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *grass_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag to draw grass. Don’t forget the dirt!"))); } // Affect the canvas on drag: -void grass_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void grass_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 4, do_grass); @@ -161,31 +161,31 @@ void grass_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void grass_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void grass_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { grass_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void grass_release(magic_api * api ATTRIBUTE_UNUSED, +void grass_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void grass_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void grass_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (grass_snd != NULL) Mix_FreeChunk(grass_snd); } // Record the color from Tux Paint: -void grass_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void grass_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { grass_r = r; grass_g = g; @@ -193,13 +193,13 @@ void grass_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE } // Use colors: -int grass_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int grass_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } static void do_grass(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -274,35 +274,35 @@ static int log2int(int x) return y; } -void grass_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void grass_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void grass_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void grass_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int grass_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int grass_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 grass_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 grass_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { /* FIXME: Perhaps some day this could be for blade thickness, height, randomness, or something else...? -bjk 2023.04.18 */ return 0; } -Uint8 grass_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 grass_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void grass_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void grass_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/halftone.c b/magic/src/halftone.c index c460a11bc..aaeee413b 100644 --- a/magic/src/halftone.c +++ b/magic/src/halftone.c @@ -97,7 +97,7 @@ Uint32 halftone_api_version(void) return (TP_MAGIC_API_VERSION); } -int halftone_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int halftone_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -116,12 +116,12 @@ int halftone_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin return (1); } -int halftone_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int halftone_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } -SDL_Surface *halftone_get_icon(magic_api * api, int which) +SDL_Surface *halftone_get_icon(magic_api *api, int which) { char fname[1024]; @@ -130,7 +130,7 @@ SDL_Surface *halftone_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *halftone_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *halftone_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { const char *our_name_english; const char *our_name_localized; @@ -141,7 +141,7 @@ char *halftone_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) return (strdup(our_name_localized)); } -int halftone_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int halftone_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { return groups[which]; } @@ -151,7 +151,7 @@ int halftone_get_order(int which) return orders[which]; } -char *halftone_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *halftone_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { const char *our_desc_english; const char *our_desc_localized; @@ -162,17 +162,17 @@ char *halftone_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int return (strdup(our_desc_localized)); } -int halftone_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int halftone_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -int halftone_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int halftone_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -void halftone_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void halftone_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -188,8 +188,8 @@ void halftone_shutdown(magic_api * api ATTRIBUTE_UNUSED) SDL_FreeSurface(square); } -void halftone_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void halftone_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int full_x, full_y; @@ -214,8 +214,8 @@ void halftone_click(magic_api * api, int which, int mode, } } -void halftone_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void halftone_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, snapshot, ox, oy, x, y, 4, halftone_line_callback); @@ -271,24 +271,24 @@ int chan_angles[NUM_CHANS] = { 45 /* Black */ }; -void halftone_release(magic_api * api ATTRIBUTE_UNUSED, +void halftone_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void halftone_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void halftone_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } void halftone_line_callback(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { Uint8 r, g, b, or, og, ob; Uint32 total_r, total_g, total_b; @@ -381,7 +381,7 @@ void halftone_line_callback(void *ptr, int which ATTRIBUTE_UNUSED, SDL_BlitSurface(square, NULL, canvas, &dest); } -void halftone_switchin(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void halftone_switchin(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { if (canvas_backup == NULL) { @@ -402,8 +402,8 @@ void halftone_switchin(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATT SDL_BlitSurface(canvas, NULL, canvas_backup, NULL); } -void halftone_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void halftone_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } @@ -443,18 +443,18 @@ void halftone_rgb2cmyk(Uint8 r, Uint8 g, Uint8 b, float cmyk[]) } -Uint8 halftone_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 halftone_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; // No size support at this time } -Uint8 halftone_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 halftone_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; // No size support at this time } -void halftone_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void halftone_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/kaleidox.c b/magic/src/kaleidox.c index 35fed9749..76e5cb12a 100644 --- a/magic/src/kaleidox.c +++ b/magic/src/kaleidox.c @@ -84,7 +84,7 @@ Uint32 kaleidox_api_version(void) return (TP_MAGIC_API_VERSION); } -int kaleidox_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int kaleidox_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -98,13 +98,13 @@ int kaleidox_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin return (1); } -int kaleidox_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int kaleidox_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } -SDL_Surface *kaleidox_get_icon(magic_api * api, int which) +SDL_Surface *kaleidox_get_icon(magic_api *api, int which) { char fname[1024]; @@ -113,12 +113,12 @@ SDL_Surface *kaleidox_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *kaleidox_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *kaleidox_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return strdup(gettext(kaleidox_names[which])); } -int kaleidox_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int kaleidox_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -128,22 +128,22 @@ int kaleidox_get_order(int which) return 800 + which; } -char *kaleidox_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *kaleidox_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return strdup(gettext(kaleidox_descrs[which])); } -int kaleidox_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int kaleidox_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -int kaleidox_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int kaleidox_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT_WITH_PREVIEW; } -void kaleidox_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void kaleidox_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -155,8 +155,8 @@ void kaleidox_shutdown(magic_api * api ATTRIBUTE_UNUSED) } void -kaleidox_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +kaleidox_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { api->stopsound(); @@ -193,9 +193,9 @@ int mirror(int n, int max, int flip) } void -kaleidox_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, - int x, int y, SDL_Rect * update_rect) +kaleidox_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, + int x, int y, SDL_Rect *update_rect) { if (snd_effects[which] != NULL) { @@ -210,8 +210,7 @@ kaleidox_drag(magic_api * api, int which, SDL_Surface * canvas, update_rect->h = canvas->h; } -void kaleidox_render(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int x, int y, int preview) +void kaleidox_render(magic_api *api, int which, SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, int preview) { int off_x, off_y, sides, max_radius; float angle, angle_offset; @@ -306,8 +305,8 @@ void kaleidox_render(magic_api * api, int which, SDL_Surface * canvas, } -void kaleidox_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void kaleidox_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { kaleidox_render(api, which, canvas, snapshot, x, y, 0); @@ -320,26 +319,26 @@ void kaleidox_release(magic_api * api, int which, } -void kaleidox_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, +void kaleidox_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void kaleidox_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void kaleidox_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void kaleidox_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void kaleidox_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -Uint8 kaleidox_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 kaleidox_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { /* I considered having this plugin collapse down to one tool * with multiple sizes, but decided to leave it as three separate @@ -347,13 +346,13 @@ Uint8 kaleidox_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIB return 0; } -Uint8 kaleidox_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 kaleidox_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void kaleidox_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void kaleidox_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/kalidescope.c b/magic/src/kalidescope.c index 6b1e57948..ae9f8da95 100644 --- a/magic/src/kalidescope.c +++ b/magic/src/kalidescope.c @@ -95,7 +95,7 @@ Uint32 kalidescope_api_version(void) return (TP_MAGIC_API_VERSION); } -int kalidescope_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int kalidescope_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -105,13 +105,13 @@ int kalidescope_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, return (1); } -int kalidescope_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int kalidescope_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (KAL_COUNT); } // Load our icons: -SDL_Surface *kalidescope_get_icon(magic_api * api, int which) +SDL_Surface *kalidescope_get_icon(magic_api *api, int which) { char fname[1024]; @@ -121,7 +121,7 @@ SDL_Surface *kalidescope_get_icon(magic_api * api, int which) } // Return our names, localized: -char *kalidescope_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *kalidescope_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == KAL_LR) { @@ -146,7 +146,7 @@ char *kalidescope_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) } // Return our group (all the same): -int kalidescope_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int kalidescope_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PATTERN_PAINTING; } @@ -159,7 +159,7 @@ int kalidescope_get_order(int which) // Return our descriptions, localized: -char *kalidescope_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *kalidescope_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (which == KAL_LR) { @@ -189,8 +189,7 @@ char *kalidescope_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, i // Do the effect: -static void do_kalidescope(void *ptr, int which, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) +static void do_kalidescope(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -236,8 +235,8 @@ static void do_kalidescope(void *ptr, int which, SDL_Surface * canvas, } // Affect the canvas on drag: -void kalidescope_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void kalidescope_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_kalidescope); @@ -250,38 +249,38 @@ void kalidescope_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void kalidescope_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void kalidescope_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { kalidescope_drag(api, which, canvas, last, x, y, x, y, update_rect); } // Affect the canvas on release: -void kalidescope_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void kalidescope_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { api->stopsound(); } // No setup happened: -void kalidescope_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void kalidescope_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (kalidescope_snd != NULL) Mix_FreeChunk(kalidescope_snd); } // Use colors: -int kalidescope_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int kalidescope_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } // Record the color from Tux Paint: -void kalidescope_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void kalidescope_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { kalidescope_r = r; kalidescope_g = g; @@ -289,37 +288,36 @@ void kalidescope_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE } // Use sizes: -Uint8 kalidescope_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 kalidescope_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return KAL_MAX_SIZE; } -Uint8 kalidescope_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 kalidescope_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return KAL_DEF_SIZE; } // Record the size from Tux Paint: -void kalidescope_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 sz, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void kalidescope_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { kalidescope_sz = (sz * 2); } -void kalidescope_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void kalidescope_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void kalidescope_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void kalidescope_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int kalidescope_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int kalidescope_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } diff --git a/magic/src/light.c b/magic/src/light.c index 2f39388ea..7740a5220 100644 --- a/magic/src/light.c +++ b/magic/src/light.c @@ -78,7 +78,7 @@ Uint32 light_api_version(void) // No setup required: -int light_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int light_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -92,13 +92,13 @@ int light_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 } // We have multiple tools: -int light_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int light_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *light_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *light_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -108,13 +108,13 @@ SDL_Surface *light_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *light_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *light_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Light"))); } // Return our groups: -int light_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int light_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -126,7 +126,7 @@ int light_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *light_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *light_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag to draw a beam of light on your picture."))); } @@ -134,7 +134,7 @@ char *light_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT // Do the effect: static void do_light(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -194,8 +194,8 @@ static void do_light(void *ptr, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void light_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void light_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_light); @@ -223,22 +223,22 @@ void light_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void light_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void light_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { light_drag(api, which, canvas, last, x, y, x, y, update_rect); } // Affect the canvas on release: -void light_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, - int x, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void light_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, + int x, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { api->playsound(light2_snd, (x * 255) / canvas->w, 255); } // No setup happened: -void light_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void light_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (light1_snd != NULL) Mix_FreeChunk(light1_snd); @@ -247,48 +247,48 @@ void light_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void light_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void light_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { api->rgbtohsv(r, g, b, &light_h, &light_s, &light_v); } // Use colors: -int light_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int light_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void light_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void light_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void light_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void light_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int light_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int light_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 light_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 light_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -Uint8 light_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 light_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void light_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void light_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { light_radius = size * 4; } diff --git a/magic/src/lightning.c b/magic/src/lightning.c index f4462d61c..cd600690c 100644 --- a/magic/src/lightning.c +++ b/magic/src/lightning.c @@ -55,7 +55,7 @@ Uint32 lightning_api_version(void) return (TP_MAGIC_API_VERSION); } -int lightning_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int lightning_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -65,13 +65,13 @@ int lightning_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Ui return (1); } -int lightning_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int lightning_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *lightning_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *lightning_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -80,12 +80,12 @@ SDL_Surface *lightning_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *lightning_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *lightning_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Lightning")); } -int lightning_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int lightning_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_ARTISTIC; } @@ -95,22 +95,22 @@ int lightning_get_order(int which ATTRIBUTE_UNUSED) return 400; } -char *lightning_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *lightning_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext("Click, drag, and release to draw a lightning bolt between two points.")); } -int lightning_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int lightning_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -int lightning_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int lightning_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -void lightning_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void lightning_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (snd_effect != NULL) Mix_FreeChunk(snd_effect); @@ -118,8 +118,8 @@ void lightning_shutdown(magic_api * api ATTRIBUTE_UNUSED) void -lightning_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +lightning_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { sx = x; sy = y; @@ -128,9 +128,9 @@ lightning_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, void -lightning_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox ATTRIBUTE_UNUSED, - int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +lightning_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, + int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { /* FIXME: This could be made more efficient (only blit and update between (sx,sy) and (x,y), though @@ -148,8 +148,8 @@ lightning_drag(magic_api * api, int which, SDL_Surface * canvas, void -lightning_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +lightning_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { float a, b, len, angle; int thickness; @@ -192,8 +192,8 @@ lightning_release(magic_api * api, int which ATTRIBUTE_UNUSED, lightning_draw_bolt((void *)api, canvas, snapshot, (float)sx, (float)sy, angle, len, thickness); } -void lightning_draw_bolt(void *ptr, SDL_Surface * canvas, - SDL_Surface * snapshot, float sx, float sy, float angle, float len, int thickness) +void lightning_draw_bolt(void *ptr, SDL_Surface *canvas, + SDL_Surface *snapshot, float sx, float sy, float angle, float len, int thickness) { magic_api *api = (magic_api *) ptr; float i; @@ -283,44 +283,44 @@ void lightning_draw_bolt(void *ptr, SDL_Surface * canvas, } -void lightning_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void lightning_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { api->rgbtohsv(r, g, b, &lightning_h, &lightning_s, &lightning_v); } void lightning_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; api->xorpixel(canvas, x, y); } -void lightning_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void lightning_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void lightning_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void lightning_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -Uint8 lightning_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 lightning_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 lightning_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 lightning_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void lightning_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void lightning_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/maze.c b/magic/src/maze.c index 35d1e3b6d..abfd02578 100644 --- a/magic/src/maze.c +++ b/magic/src/maze.c @@ -81,7 +81,7 @@ Uint32 maze_api_version(void) return (TP_MAGIC_API_VERSION); } -int maze_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int maze_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -91,13 +91,13 @@ int maze_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 c return (1); } -int maze_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int maze_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *maze_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *maze_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -106,12 +106,12 @@ SDL_Surface *maze_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *maze_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *maze_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Maze")); } -int maze_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int maze_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -121,7 +121,7 @@ int maze_get_order(int which ATTRIBUTE_UNUSED) return 2000; } -char *maze_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *maze_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return (gettext("Click and drag to paint a maze on your picture.")); @@ -129,17 +129,17 @@ char *maze_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE return (gettext("Click to turn your entire picture into a maze.")); } -int maze_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int maze_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -int maze_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int maze_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT | MODE_FULLSCREEN; } -void maze_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void maze_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (snd_effect != NULL) Mix_FreeChunk(snd_effect); @@ -169,8 +169,8 @@ int check_arrays(void) } void -maze_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +maze_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { if (!check_arrays()) return; @@ -213,9 +213,8 @@ maze_click(magic_api * api, int which, int mode, void -maze_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox ATTRIBUTE_UNUSED, - int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +maze_drag(magic_api *api ATTRIBUTE_UNUSED, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { if (!check_arrays()) return; @@ -229,9 +228,9 @@ maze_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canvas, } -void maze_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) +void maze_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect) { if (snd_effect != NULL) api->stopsound(); @@ -253,7 +252,7 @@ void maze_release(magic_api * api, int which ATTRIBUTE_UNUSED, #define STATE_KEEPGOING 1 #define STATE_PICKDIR 2 -void maze_render(magic_api * api, SDL_Surface * canvas) +void maze_render(magic_api *api, SDL_Surface *canvas) { int x, y, nx, ny, btwn_nx, btwn_ny, state, dir, old_dir, s; Uint32 iter; @@ -360,9 +359,9 @@ void maze_render(magic_api * api, SDL_Surface * canvas) } -void maze_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void maze_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { maze_r = r; maze_g = g; @@ -371,7 +370,7 @@ void maze_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED void maze_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy, idx; @@ -406,8 +405,8 @@ void maze_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED, } } -void maze_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void maze_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { if (maze_array == NULL) { @@ -476,13 +475,13 @@ void maze_switchin(magic_api * api ATTRIBUTE_UNUSED, SDL_BlitSurface(canvas, NULL, maze_snapshot, NULL); } -void maze_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void maze_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { zero_maze_arrays(canvas); } -void zero_maze_arrays(SDL_Surface * canvas) +void zero_maze_arrays(SDL_Surface *canvas) { num_maze_starts = 0; @@ -499,7 +498,7 @@ void zero_maze_arrays(SDL_Surface * canvas) memset(maze_color, 0, (sizeof(Uint32) * (canvas->w * canvas->h))); } -void draw_hall(SDL_Surface * canvas, int x, int y) +void draw_hall(SDL_Surface *canvas, int x, int y) { int xx, yy; @@ -526,7 +525,7 @@ void maze_add_start(void) num_maze_starts++; } -void maze_collapse_contiguous(SDL_Surface * canvas) +void maze_collapse_contiguous(SDL_Surface *canvas) { int i, x, y, touching, idx; @@ -579,18 +578,18 @@ void maze_collapse_contiguous(SDL_Surface * canvas) } } -Uint8 maze_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 maze_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 maze_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 maze_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void maze_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void maze_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/metalpaint.c b/magic/src/metalpaint.c index 43fb874a4..b65637c25 100644 --- a/magic/src/metalpaint.c +++ b/magic/src/metalpaint.c @@ -73,7 +73,7 @@ Uint32 metalpaint_api_version(void) // No setup required: -int metalpaint_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int metalpaint_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -84,13 +84,13 @@ int metalpaint_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, U } // We have multiple tools: -int metalpaint_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int metalpaint_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *metalpaint_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *metalpaint_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -100,13 +100,13 @@ SDL_Surface *metalpaint_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *metalpaint_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *metalpaint_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Metal Paint"))); } // Return our groups: -int metalpaint_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int metalpaint_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -118,8 +118,7 @@ int metalpaint_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *metalpaint_get_description(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *metalpaint_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag the mouse to paint with a metallic color."))); } @@ -138,7 +137,7 @@ static int metalpaint_gradient[METALPAINT_CYCLE] = { // Do the effect: static void do_metalpaint(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -161,8 +160,8 @@ static void do_metalpaint(void *ptr, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void metalpaint_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void metalpaint_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_metalpaint); @@ -190,32 +189,32 @@ void metalpaint_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void metalpaint_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void metalpaint_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { metalpaint_drag(api, which, canvas, last, x, y, x, y, update_rect); } // Affect the canvas on release: -void metalpaint_release(magic_api * api ATTRIBUTE_UNUSED, +void metalpaint_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void metalpaint_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void metalpaint_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (metalpaint_snd != NULL) Mix_FreeChunk(metalpaint_snd); } // Record the color from Tux Paint: -void metalpaint_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void metalpaint_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { metalpaint_r = min(255, r + 64); metalpaint_g = min(255, g + 64); @@ -223,40 +222,40 @@ void metalpaint_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ } // Use colors: -int metalpaint_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int metalpaint_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void metalpaint_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void metalpaint_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void metalpaint_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void metalpaint_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int metalpaint_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int metalpaint_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 metalpaint_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 metalpaint_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 6; } -Uint8 metalpaint_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 metalpaint_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void metalpaint_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void metalpaint_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { metalpaint_size = size * 4; } diff --git a/magic/src/mirror_f.c b/magic/src/mirror_f.c index f21752ce9..36b64c4c8 100644 --- a/magic/src/mirror_f.c +++ b/magic/src/mirror_f.c @@ -68,7 +68,7 @@ TX_EXTERN void mirror_f_set_size(magic_api * api, int which, int mode, SDL_Surfa Uint8 size, SDL_Rect * update_rect); // No setup required: -TX_EXTERN int mirror_f_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, +TX_EXTERN int mirror_f_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -88,13 +88,13 @@ TX_EXTERN Uint32 mirror_f_api_version(void) } // We have multiple tools: -TX_EXTERN int mirror_f_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +TX_EXTERN int mirror_f_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } // Load our icons: -TX_EXTERN SDL_Surface *mirror_f_get_icon(magic_api * api, int which) +TX_EXTERN SDL_Surface *mirror_f_get_icon(magic_api *api, int which) { char fname[1024]; @@ -111,7 +111,7 @@ TX_EXTERN SDL_Surface *mirror_f_get_icon(magic_api * api, int which) } // Return our names, localized: -TX_EXTERN char *mirror_f_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +TX_EXTERN char *mirror_f_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == TOOL_MIRROR) return (strdup(gettext("Mirror"))); @@ -122,7 +122,7 @@ TX_EXTERN char *mirror_f_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) } // Return our group (the same): -TX_EXTERN int mirror_f_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +TX_EXTERN int mirror_f_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -134,7 +134,7 @@ int mirror_f_get_order(int which) } // Return our descriptions, localized: -TX_EXTERN char *mirror_f_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +TX_EXTERN char *mirror_f_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (which == TOOL_MIRROR) return (strdup(gettext("Click to make a mirror image."))); @@ -145,30 +145,30 @@ TX_EXTERN char *mirror_f_get_description(magic_api * api ATTRIBUTE_UNUSED, int w } // We affect the whole canvas, so only do things on click, not drag: -TX_EXTERN void mirror_f_drag(magic_api * api ATTRIBUTE_UNUSED, +TX_EXTERN void mirror_f_drag(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { // No-op } -TX_EXTERN void mirror_f_release(magic_api * api ATTRIBUTE_UNUSED, +TX_EXTERN void mirror_f_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { // No-op } // Affect the canvas on click: -TX_EXTERN void mirror_f_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) +TX_EXTERN void mirror_f_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect) { int xx, yy; SDL_Rect src, dest; @@ -217,7 +217,7 @@ TX_EXTERN void mirror_f_click(magic_api * api, int which, int mode ATTRIBUTE_UNU } // No setup happened: -TX_EXTERN void mirror_f_shutdown(magic_api * api ATTRIBUTE_UNUSED) +TX_EXTERN void mirror_f_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (snd_effects[0] != NULL) Mix_FreeChunk(snd_effects[0]); @@ -226,52 +226,52 @@ TX_EXTERN void mirror_f_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // We don't use colors: -TX_EXTERN void mirror_f_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +TX_EXTERN void mirror_f_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // We don't use colors: -TX_EXTERN int mirror_f_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +TX_EXTERN int mirror_f_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -TX_EXTERN void mirror_f_switchin(magic_api * api ATTRIBUTE_UNUSED, +TX_EXTERN void mirror_f_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -TX_EXTERN void mirror_f_switchout(magic_api * api ATTRIBUTE_UNUSED, +TX_EXTERN void mirror_f_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -TX_EXTERN int mirror_f_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +TX_EXTERN int mirror_f_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN); } -TX_EXTERN Uint8 mirror_f_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, +TX_EXTERN Uint8 mirror_f_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -TX_EXTERN Uint8 mirror_f_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, +TX_EXTERN Uint8 mirror_f_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -TX_EXTERN void mirror_f_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +TX_EXTERN void mirror_f_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size ATTRIBUTE_UNUSED, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/mosaic.c b/magic/src/mosaic.c index abf13004c..ab20b19d1 100644 --- a/magic/src/mosaic.c +++ b/magic/src/mosaic.c @@ -122,7 +122,7 @@ Uint32 mosaic_api_version(void) } //Load sounds -int mosaic_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int mosaic_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; @@ -137,13 +137,13 @@ int mosaic_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int mosaic_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int mosaic_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (mosaic_NUM_TOOLS); } // Load our icons: -SDL_Surface *mosaic_get_icon(magic_api * api, int which) +SDL_Surface *mosaic_get_icon(magic_api *api, int which) { char fname[1024]; @@ -152,13 +152,13 @@ SDL_Surface *mosaic_get_icon(magic_api * api, int which) } // Return our names, localized: -char *mosaic_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *mosaic_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(mosaic_names[which]))); } // Return our groups: -int mosaic_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int mosaic_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { return mosaic_groups[which]; } @@ -170,7 +170,7 @@ int mosaic_get_order(int which) } // Return our descriptions, localized: -char *mosaic_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *mosaic_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return (strdup(gettext(mosaic_descs[which][mode - 1]))); } @@ -182,8 +182,8 @@ static int mosaic_grey(Uint8 r1, Uint8 g1, Uint8 b1) } // Do the effect for the full image -static void do_mosaic_full(void *ptr, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +static void do_mosaic_full(void *ptr, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { magic_api *api = (magic_api *) ptr; @@ -228,7 +228,7 @@ static void do_mosaic_full(void *ptr, SDL_Surface * canvas, /* Paint the brush, noise is yet done at switchin, blurs 2 pixels around the brush in order to get sharpen well done.*/ void mosaic_paint(void *ptr_to_api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { int i, j, pix_row_pos; @@ -256,8 +256,8 @@ void mosaic_paint(void *ptr_to_api, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void mosaic_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void mosaic_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line(api, which, canvas, last, ox, oy, x, y, 1, mosaic_paint); @@ -270,8 +270,8 @@ void mosaic_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void mosaic_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void mosaic_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_FULLSCREEN) @@ -291,16 +291,16 @@ void mosaic_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void mosaic_release(magic_api * api ATTRIBUTE_UNUSED, +void mosaic_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void mosaic_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void mosaic_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -315,21 +315,21 @@ void mosaic_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void mosaic_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void mosaic_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int mosaic_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int mosaic_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } //Add noise to a pixel -static void mosaic_noise_pixel(void *ptr, SDL_Surface * canvas, int noise_AMOUNT, int x, int y) +static void mosaic_noise_pixel(void *ptr, SDL_Surface *canvas, int noise_AMOUNT, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -346,7 +346,7 @@ static void mosaic_noise_pixel(void *ptr, SDL_Surface * canvas, int noise_AMOUNT } //Blur a pixel -static void mosaic_blur_pixel(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void mosaic_blur_pixel(void *ptr, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; int i, j, k; @@ -386,7 +386,7 @@ static void mosaic_blur_pixel(void *ptr, SDL_Surface * canvas, SDL_Surface * las } //Sharpen a pixel -static void mosaic_sharpen_pixel(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void mosaic_sharpen_pixel(void *ptr, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -433,7 +433,7 @@ static void mosaic_sharpen_pixel(void *ptr, SDL_Surface * canvas, SDL_Surface * } -void mosaic_switchin(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void mosaic_switchin(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { int y, x; Uint32 amask; @@ -477,8 +477,8 @@ void mosaic_switchin(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRI reset_mosaic_blured(canvas); } -void mosaic_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void mosaic_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { SDL_FreeSurface(canvas_noise); SDL_FreeSurface(canvas_blur); @@ -486,12 +486,12 @@ void mosaic_switchout(magic_api * api ATTRIBUTE_UNUSED, free(mosaic_blured); } -int mosaic_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int mosaic_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -void reset_mosaic_blured(SDL_Surface * canvas) +void reset_mosaic_blured(SDL_Surface *canvas) { int i, j; @@ -502,7 +502,7 @@ void reset_mosaic_blured(SDL_Surface * canvas) } -Uint8 mosaic_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 mosaic_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -510,14 +510,14 @@ Uint8 mosaic_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT return 0; } -Uint8 mosaic_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 mosaic_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void mosaic_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void mosaic_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { mosaic_RADIUS = size * 4; } diff --git a/magic/src/mosaic_shaped.c b/magic/src/mosaic_shaped.c index cdd8b177e..43f307926 100644 --- a/magic/src/mosaic_shaped.c +++ b/magic/src/mosaic_shaped.c @@ -171,7 +171,7 @@ Uint32 mosaic_shaped_api_version(void) } //Load sounds -int mosaic_shaped_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, +int mosaic_shaped_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; @@ -188,13 +188,13 @@ int mosaic_shaped_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED return (1); } -int mosaic_shaped_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int mosaic_shaped_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (mosaic_shaped_NUM_TOOLS); } // Load our icons: -SDL_Surface *mosaic_shaped_get_icon(magic_api * api, int which) +SDL_Surface *mosaic_shaped_get_icon(magic_api *api, int which) { char fname[1024]; @@ -203,13 +203,13 @@ SDL_Surface *mosaic_shaped_get_icon(magic_api * api, int which) } // Return our names, localized: -char *mosaic_shaped_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *mosaic_shaped_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(mosaic_shaped_names[which]))); } // Return our groups (all the same!) -int mosaic_shaped_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int mosaic_shaped_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -221,7 +221,7 @@ int mosaic_shaped_get_order(int which) } // Return our descriptions, localized: -char *mosaic_shaped_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *mosaic_shaped_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return (strdup(gettext(mosaic_shaped_descs[which][mode - 1]))); } @@ -233,9 +233,9 @@ static int mosaic_shaped_grey(Uint8 r1, Uint8 g1, Uint8 b1) } // Do the effect for the full image -static void do_mosaic_shaped_full(void *ptr, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +static void do_mosaic_shaped_full(void *ptr, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { int i, j, size; Uint32 mosaic_shaped_color; @@ -279,7 +279,7 @@ static void do_mosaic_shaped_full(void *ptr, SDL_Surface * canvas, /* Fills a tesera */ static void mosaic_shaped_fill(void *ptr_to_api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { Uint32 mosaic_shaped_color; int size; @@ -314,8 +314,8 @@ static void mosaic_shaped_fill(void *ptr_to_api, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void mosaic_shaped_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void mosaic_shaped_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line(api, which, canvas, last, ox, oy, x, y, 1, mosaic_shaped_fill); update_rect->x = min(ox, x) - mosaic_shaped_pattern->w; @@ -326,8 +326,8 @@ void mosaic_shaped_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void mosaic_shaped_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void mosaic_shaped_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_FULLSCREEN) { @@ -345,16 +345,16 @@ void mosaic_shaped_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void mosaic_shaped_release(magic_api * api ATTRIBUTE_UNUSED, +void mosaic_shaped_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void mosaic_shaped_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void mosaic_shaped_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -369,9 +369,9 @@ void mosaic_shaped_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void mosaic_shaped_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, - Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void mosaic_shaped_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, + Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { mosaic_shaped_r = r; mosaic_shaped_g = g; @@ -379,14 +379,14 @@ void mosaic_shaped_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU } // Use colors: -int mosaic_shaped_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int mosaic_shaped_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } //Sharpen a pixel static void mosaic_shaped_sharpen_pixel(void *ptr, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last, int x, int y) + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; Uint8 r1, g1, b1; @@ -430,7 +430,7 @@ static void mosaic_shaped_sharpen_pixel(void *ptr, -void mosaic_shaped_switchin(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void mosaic_shaped_switchin(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { int y, x; int i, j; @@ -656,9 +656,9 @@ void mosaic_shaped_switchin(magic_api * api, int which, int mode ATTRIBUTE_UNUSE reset_counter(canvas, mosaic_shaped_done); } -void mosaic_shaped_switchout(magic_api * api ATTRIBUTE_UNUSED, +void mosaic_shaped_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) + int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { SDL_FreeSurface(canvas_shaped); SDL_FreeSurface(canvas_back); @@ -666,12 +666,12 @@ void mosaic_shaped_switchout(magic_api * api ATTRIBUTE_UNUSED, free(mosaic_shaped_counted); } -int mosaic_shaped_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int mosaic_shaped_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -void reset_counter(SDL_Surface * canvas, Uint8 * counter) +void reset_counter(SDL_Surface *canvas, Uint8 *counter) { int i, j; @@ -685,7 +685,7 @@ void reset_counter(SDL_Surface * canvas, Uint8 * counter) int scan_fill_count; -int scan_fill(magic_api * api, SDL_Surface * canvas, SDL_Surface * srfc, +int scan_fill(magic_api *api, SDL_Surface *canvas, SDL_Surface *srfc, int x, int y, int fill_edge, int fill_tile, int size, Uint32 color) { int leftx, rightx; @@ -775,7 +775,7 @@ int scan_fill(magic_api * api, SDL_Surface * canvas, SDL_Surface * srfc, } -void fill_square(magic_api * api, SDL_Surface * canvas, int x, int y, int size, Uint32 color) +void fill_square(magic_api *api, SDL_Surface *canvas, int x, int y, int size, Uint32 color) { int i, j; @@ -786,7 +786,7 @@ void fill_square(magic_api * api, SDL_Surface * canvas, int x, int y, int size, } } -void deform(magic_api * api, SDL_Surface * srfc) +void deform(magic_api *api, SDL_Surface *srfc) { int i, j; @@ -805,7 +805,7 @@ void deform(magic_api * api, SDL_Surface * srfc) /* Paints a 2 pixel square with black and shadows around 3 more pixels */ static void mosaic_shaped_paint(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int radius, shadow; @@ -860,20 +860,19 @@ static void mosaic_shaped_paint(void *ptr, int which ATTRIBUTE_UNUSED, } -Uint8 mosaic_shaped_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, +Uint8 mosaic_shaped_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 mosaic_shaped_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED) +Uint8 mosaic_shaped_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void mosaic_shaped_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void mosaic_shaped_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/n_pt_persp.c b/magic/src/n_pt_persp.c index 760529204..2cacf1b09 100644 --- a/magic/src/n_pt_persp.c +++ b/magic/src/n_pt_persp.c @@ -350,7 +350,7 @@ Uint32 n_pt_persp_api_version(void) } -int n_pt_persp_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level) +int n_pt_persp_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level) { int i; char filename[1024]; @@ -459,13 +459,13 @@ int n_pt_persp_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, U } -int n_pt_persp_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int n_pt_persp_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (num_tools[complexity]); } -SDL_Surface *n_pt_persp_get_icon(magic_api * api, int which) +SDL_Surface *n_pt_persp_get_icon(magic_api *api, int which) { char filename[1024]; @@ -481,7 +481,7 @@ SDL_Surface *n_pt_persp_get_icon(magic_api * api, int which) } -char *n_pt_persp_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *n_pt_persp_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { #ifdef DEBUG printf("\nn_pt_persp_get_name\n"); @@ -492,7 +492,7 @@ char *n_pt_persp_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) } -int n_pt_persp_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int n_pt_persp_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MAGIC_TYPE_PROJECTIONS); } @@ -504,7 +504,7 @@ int n_pt_persp_get_order(int which) } -char *n_pt_persp_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *n_pt_persp_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { #ifdef DEBUG printf("\nn_pt_persp_get_description\n"); @@ -515,7 +515,7 @@ char *n_pt_persp_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, in } -int n_pt_persp_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which) +int n_pt_persp_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which) { #ifdef DEBUG printf("\nn_pt_persp_requires_colors\n"); @@ -534,12 +534,12 @@ int n_pt_persp_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which) } -int n_pt_persp_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int n_pt_persp_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 n_pt_persp_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +Uint8 n_pt_persp_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { #ifdef DEBUG printf("\nn_pt_persp_accepted_sizes\n"); @@ -562,13 +562,13 @@ Uint8 n_pt_persp_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which, int } -Uint8 n_pt_persp_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 n_pt_persp_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 1; } -void n_pt_persp_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void n_pt_persp_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -587,8 +587,8 @@ void n_pt_persp_shutdown(magic_api * api ATTRIBUTE_UNUSED) } -void n_pt_persp_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void n_pt_persp_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int pick, i, tool; float dist, min_dist; @@ -788,7 +788,7 @@ void n_pt_persp_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } -void n_pt_persp_vanish_pt_moved(magic_api * api, int which, SDL_Surface * canvas, SDL_Rect * update_rect) +void n_pt_persp_vanish_pt_moved(magic_api *api, int which, SDL_Surface *canvas, SDL_Rect *update_rect) { SDL_BlitSurface(n_pt_persp_snapshot, NULL, canvas, NULL); n_pt_persp_draw_points(api, which, canvas); @@ -803,9 +803,9 @@ void n_pt_persp_vanish_pt_moved(magic_api * api, int which, SDL_Surface * canvas /* Affect the canvas on drag: */ -void n_pt_persp_drag(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int old_x ATTRIBUTE_UNUSED, int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void n_pt_persp_drag(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int old_x ATTRIBUTE_UNUSED, int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { int i, x1, y1, x2, y2; float slope; @@ -1151,7 +1151,7 @@ void n_pt_persp_drag(magic_api * api, int which, #endif } -void n_pt_persp_work(magic_api * api, int tool, SDL_Surface * canvas, int x, int y, SDL_Rect * update_rect, int xor) +void n_pt_persp_work(magic_api *api, int tool, SDL_Surface *canvas, int x, int y, SDL_Rect *update_rect, int xor) { int x1, y1, x2, y2; float slope, slope2; @@ -1455,9 +1455,9 @@ void n_pt_persp_work(magic_api * api, int tool, SDL_Surface * canvas, int x, int } -void n_pt_persp_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x, int y, SDL_Rect * update_rect) +void n_pt_persp_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x, int y, SDL_Rect *update_rect) { #ifdef DEBUG printf("\nn_pt_persp_release\n"); @@ -1514,10 +1514,10 @@ void n_pt_persp_release(magic_api * api, int which, } -void n_pt_persp_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void n_pt_persp_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { n_pt_persp_r = r; n_pt_persp_g = g; @@ -1525,16 +1525,16 @@ void n_pt_persp_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ } -void n_pt_persp_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void n_pt_persp_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { n_pt_persp_size = ((size - 1) * 2) + 1; } -void n_pt_persp_line_xor_callback(void *pointer, int tool ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) +void n_pt_persp_line_xor_callback(void *pointer, int tool ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) pointer; @@ -1542,8 +1542,8 @@ void n_pt_persp_line_xor_callback(void *pointer, int tool ATTRIBUTE_UNUSED, SDL_ api->xorpixel(canvas, x + 1, y + 1); } -void n_pt_persp_line_xor_thick_callback(void *pointer, int tool ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) +void n_pt_persp_line_xor_thick_callback(void *pointer, int tool ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { int i, j; @@ -1562,7 +1562,7 @@ void n_pt_persp_line_xor_thick_callback(void *pointer, int tool ATTRIBUTE_UNUSED } void n_pt_persp_line_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { SDL_Rect r; @@ -1574,7 +1574,7 @@ void n_pt_persp_line_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE SDL_FillRect(canvas, &r, SDL_MapRGB(canvas->format, n_pt_persp_r, n_pt_persp_g, n_pt_persp_b)); } -void n_pt_persp_switchin(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void n_pt_persp_switchin(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { #ifdef DEBUG printf("\nn_pt_persp_switchin\n"); @@ -1593,7 +1593,7 @@ void n_pt_persp_switchin(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } } -void n_pt_persp_switchout(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void n_pt_persp_switchout(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { #ifdef DEBUG printf("\nn_pt_persp_switchout\n"); @@ -1610,7 +1610,7 @@ void n_pt_persp_switchout(magic_api * api ATTRIBUTE_UNUSED, int which, int mode } } -void n_pt_persp_draw_points(magic_api * api, int tool, SDL_Surface * canvas) +void n_pt_persp_draw_points(magic_api *api, int tool, SDL_Surface *canvas) { int i, l, m, x1, y1, x2, y2, x; float slope; @@ -1877,7 +1877,7 @@ void n_pt_persp_draw_points(magic_api * api, int tool, SDL_Surface * canvas) #define DOT_WIDTH 12 -void n_pt_persp_draw_one_point(magic_api * api, SDL_Surface * canvas, int x, int y, int i) +void n_pt_persp_draw_one_point(magic_api *api, SDL_Surface *canvas, int x, int y, int i) { int xx, yy; Uint8 r, g, b; diff --git a/magic/src/negative.c b/magic/src/negative.c index 0692353ab..db88dfc7e 100644 --- a/magic/src/negative.c +++ b/magic/src/negative.c @@ -90,7 +90,7 @@ const char *negative_descs[negative_NUM_TOOLS][2] = { }; -int negative_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int negative_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -106,13 +106,13 @@ Uint32 negative_api_version(void) return (TP_MAGIC_API_VERSION); } -int negative_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int negative_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (negative_NUM_TOOLS); } // Load our icon: -SDL_Surface *negative_get_icon(magic_api * api, int which) +SDL_Surface *negative_get_icon(magic_api *api, int which) { char fname[1024]; @@ -121,13 +121,13 @@ SDL_Surface *negative_get_icon(magic_api * api, int which) } // Return our name, localized: -char *negative_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *negative_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(negative_names[which]))); } // Return our group (both the same): -int negative_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int negative_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } @@ -139,7 +139,7 @@ int negative_get_order(int which) } // Return our description, localized: -char *negative_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *negative_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { int mode_idx; @@ -159,7 +159,7 @@ char *negative_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int return (strdup(gettext(negative_descs[which][mode_idx]))); } -static void negative_calc(void *ptr, int which, Uint8 r, Uint8 g, Uint8 b, Uint8 * new_r, Uint8 * new_g, Uint8 * new_b) +static void negative_calc(void *ptr, int which, Uint8 r, Uint8 g, Uint8 b, Uint8 *new_r, Uint8 *new_g, Uint8 *new_b) { float h, s, v, new_h; magic_api *api = (magic_api *) ptr; @@ -183,7 +183,7 @@ static void negative_calc(void *ptr, int which, Uint8 r, Uint8 g, Uint8 b, Uint8 } // Callback that does the negative color effect on a circle centered around x,y -static void do_negative(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_negative(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { int xx, yy; Uint8 r, g, b, new_r, new_g, new_b; @@ -204,8 +204,8 @@ static void do_negative(void *ptr, int which, SDL_Surface * canvas, SDL_Surface } // Ask Tux Paint to call our 'do_negative()' callback over a line -void negative_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void negative_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { SDL_LockSurface(last); SDL_LockSurface(canvas); @@ -240,8 +240,8 @@ void negative_drag(magic_api * api, int which, SDL_Surface * canvas, } // Ask Tux Paint to call our 'do_negative()' callback at a single point -void negative_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void negative_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) negative_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -270,52 +270,52 @@ void negative_click(magic_api * api, int which, int mode, } -void negative_release(magic_api * api ATTRIBUTE_UNUSED, +void negative_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void negative_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void negative_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (negative_snd != NULL) Mix_FreeChunk(negative_snd); } // We don't use colors -void negative_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void negative_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // We don't use colors -int negative_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int negative_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void negative_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void negative_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void negative_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void negative_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int negative_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int negative_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 negative_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 negative_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -323,14 +323,14 @@ Uint8 negative_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIB return 0; } -Uint8 negative_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 negative_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void negative_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void negative_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { negative_radius = size * 4; } diff --git a/magic/src/noise.c b/magic/src/noise.c index cee3a81f5..53d9829e5 100644 --- a/magic/src/noise.c +++ b/magic/src/noise.c @@ -114,7 +114,7 @@ Uint32 noise_api_version(void) } //Load sounds -int noise_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int noise_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -129,13 +129,13 @@ int noise_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int noise_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int noise_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (noise_NUM_TOOLS); } // Load our icons: -SDL_Surface *noise_get_icon(magic_api * api, int which) +SDL_Surface *noise_get_icon(magic_api *api, int which) { char fname[1024]; @@ -144,13 +144,13 @@ SDL_Surface *noise_get_icon(magic_api * api, int which) } // Return our names, localized: -char *noise_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *noise_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(noise_names[which]))); } // Return our groups -int noise_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int noise_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { return noise_groups[which]; } @@ -162,14 +162,14 @@ int noise_get_order(int which) } // Return our descriptions, localized: -char *noise_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *noise_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return (strdup(gettext(noise_descs[which][mode - 1]))); } //Do the effect for one pixel static void do_noise_pixel(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -187,7 +187,7 @@ static void do_noise_pixel(void *ptr, int which ATTRIBUTE_UNUSED, } // Do the effect for the full image -static void do_noise_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) +static void do_noise_full(void *ptr, SDL_Surface *canvas, SDL_Surface *last, int which) { int x, y; @@ -201,7 +201,7 @@ static void do_noise_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, i } //do the effect for the brush -static void do_noise_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_noise_brush(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { int xx, yy; magic_api *api = (magic_api *) ptr; @@ -219,8 +219,8 @@ static void do_noise_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surfa } // Affect the canvas on drag: -void noise_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void noise_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_noise_brush); @@ -249,8 +249,8 @@ void noise_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void noise_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void noise_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) noise_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -266,16 +266,16 @@ void noise_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void noise_release(magic_api * api ATTRIBUTE_UNUSED, +void noise_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void noise_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void noise_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -290,36 +290,36 @@ void noise_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void noise_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void noise_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int noise_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int noise_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void noise_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void noise_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void noise_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void noise_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int noise_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int noise_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN | MODE_PAINT); } -Uint8 noise_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 noise_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -327,14 +327,14 @@ Uint8 noise_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE return 0; } -Uint8 noise_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 noise_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void noise_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void noise_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { noise_RADIUS = size * 4; } diff --git a/magic/src/perspective.c b/magic/src/perspective.c index 838a6bec5..9d8fe4220 100644 --- a/magic/src/perspective.c +++ b/magic/src/perspective.c @@ -196,7 +196,7 @@ Uint32 perspective_api_version(void) } //Load sounds -int perspective_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int perspective_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -209,13 +209,13 @@ int perspective_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, return (1); } -int perspective_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int perspective_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (perspective_NUM_TOOLS); } // Load our icons: -SDL_Surface *perspective_get_icon(magic_api * api, int which) +SDL_Surface *perspective_get_icon(magic_api *api, int which) { char fname[1024]; @@ -224,13 +224,13 @@ SDL_Surface *perspective_get_icon(magic_api * api, int which) } // Return our names, localized: -char *perspective_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *perspective_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(perspective_names[which]))); } // Return our group (the same): -int perspective_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int perspective_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -242,16 +242,16 @@ int perspective_get_order(int which) } // Return our descriptions, localized: -char *perspective_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *perspective_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext(perspective_descs[which]))); } // Affect the canvas on drag: -void perspective_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox ATTRIBUTE_UNUSED, - int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void perspective_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox ATTRIBUTE_UNUSED, + int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { if (canvas_back == NULL) return; @@ -372,8 +372,8 @@ void perspective_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void perspective_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void perspective_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { click_x = x; click_y = y; @@ -472,8 +472,8 @@ void perspective_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } // Affect the canvas on release: -void perspective_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void perspective_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (canvas_back == NULL) return; @@ -674,10 +674,10 @@ void perspective_release(magic_api * api, int which, } } -void perspective_preview(magic_api * api, int which, - SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect, float step) +void perspective_preview(magic_api *api, int which, + SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect, float step) { float i, j; float ax, ay, bx, by, dx, dy; @@ -762,7 +762,7 @@ void perspective_preview(magic_api * api, int which, } } -void perspective_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void perspective_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -777,8 +777,8 @@ void perspective_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void perspective_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect) +void perspective_set_color(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect) { if (r != perspective_r || g != perspective_g || b != perspective_b) { @@ -791,15 +791,15 @@ void perspective_set_color(magic_api * api, int which, SDL_Surface * canvas, } // Use colors: -int perspective_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which) +int perspective_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == TOOL_PANELS || which == TOOL_TILEZOOM || which == TOOL_RUSH) return 0; return 1; } -void perspective_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void perspective_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { Uint32 amask; @@ -836,8 +836,8 @@ void perspective_switchin(magic_api * api ATTRIBUTE_UNUSED, SDL_BlitSurface(canvas, NULL, canvas_back, NULL); } -void perspective_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void perspective_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { if (canvas_back != NULL) { @@ -846,7 +846,7 @@ void perspective_switchout(magic_api * api ATTRIBUTE_UNUSED, } } -int perspective_modes(magic_api * api ATTRIBUTE_UNUSED, int which) +int perspective_modes(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == TOOL_PANELS) { @@ -859,7 +859,7 @@ int perspective_modes(magic_api * api ATTRIBUTE_UNUSED, int which) } void perspective_line(void *ptr_to_api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr_to_api; @@ -873,19 +873,18 @@ void perspective_line(void *ptr_to_api, int which ATTRIBUTE_UNUSED, } -Uint8 perspective_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED) +Uint8 perspective_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 perspective_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 perspective_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void perspective_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void perspective_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/pixels.c b/magic/src/pixels.c index 783e3b22f..5af7eb77d 100644 --- a/magic/src/pixels.c +++ b/magic/src/pixels.c @@ -80,7 +80,7 @@ void pixels_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, // No setup required: -int pixels_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int pixels_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -96,13 +96,13 @@ Uint32 pixels_api_version(void) } // We have multiple tools: -int pixels_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int pixels_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } // Load our icons: -SDL_Surface *pixels_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *pixels_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -112,13 +112,13 @@ SDL_Surface *pixels_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *pixels_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *pixels_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Pixels"))); } // Return our group (both the same): -int pixels_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int pixels_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -130,7 +130,7 @@ int pixels_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *pixels_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *pixels_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag to draw large pixels."))); @@ -140,7 +140,7 @@ char *pixels_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU // Do the effect: static void do_pixels(void *ptr ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { SDL_Rect dest; @@ -153,8 +153,8 @@ static void do_pixels(void *ptr ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void pixels_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void pixels_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_pixels); @@ -187,31 +187,31 @@ void pixels_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void pixels_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void pixels_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { pixels_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void pixels_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void pixels_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { api->stopsound(); } // No setup happened: -void pixels_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void pixels_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (pixel_snd != NULL) Mix_FreeChunk(pixel_snd); } // Record the color from Tux Paint: -void pixels_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void pixels_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { pixels_r = r; pixels_g = g; @@ -219,40 +219,40 @@ void pixels_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS } // Use colors: -int pixels_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int pixels_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void pixels_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void pixels_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void pixels_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void pixels_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int pixels_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int pixels_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 pixels_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 pixels_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -Uint8 pixels_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 pixels_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 1; } -void pixels_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void pixels_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { int canv_area_scale; diff --git a/magic/src/polyfill.c b/magic/src/polyfill.c index a2ab2f339..b829cfbe0 100644 --- a/magic/src/polyfill.c +++ b/magic/src/polyfill.c @@ -120,7 +120,7 @@ Uint32 polyfill_api_version(void) return (TP_MAGIC_API_VERSION); } -int polyfill_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int polyfill_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char filename[1024]; @@ -135,12 +135,12 @@ int polyfill_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uin } -int polyfill_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int polyfill_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return NUM_TOOLS; } -SDL_Surface *polyfill_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *polyfill_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char filename[1024]; @@ -150,13 +150,13 @@ SDL_Surface *polyfill_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } -char *polyfill_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *polyfill_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return strdup(gettext(polyfill_names[which])); } -int polyfill_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int polyfill_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_ARTISTIC; } @@ -168,37 +168,37 @@ int polyfill_get_order(int which) } -char *polyfill_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *polyfill_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return strdup(gettext(polyfill_descr[which])); } -int polyfill_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int polyfill_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -int polyfill_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int polyfill_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 polyfill_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 polyfill_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 1; } -Uint8 polyfill_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 polyfill_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 1; } -void polyfill_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void polyfill_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -218,8 +218,8 @@ void polyfill_shutdown(magic_api * api ATTRIBUTE_UNUSED) } void -polyfill_click(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +polyfill_click(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int i; @@ -284,9 +284,9 @@ polyfill_click(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_U void -polyfill_drag(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int old_x ATTRIBUTE_UNUSED, - int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +polyfill_drag(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int old_x ATTRIBUTE_UNUSED, + int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { polyfill_dragged = 1; @@ -329,7 +329,7 @@ polyfill_drag(magic_api * api, int which ATTRIBUTE_UNUSED, update_rect->h = canvas->h; } -void polyfill_draw_preview(magic_api * api, SDL_Surface * canvas, int show_handles) +void polyfill_draw_preview(magic_api *api, SDL_Surface *canvas, int show_handles) { int i, xx, yy; SDL_Rect dest; @@ -382,9 +382,9 @@ void polyfill_draw_preview(magic_api * api, SDL_Surface * canvas, int show_handl } void -polyfill_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +polyfill_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { int i; @@ -518,8 +518,8 @@ polyfill_release(magic_api * api, int which ATTRIBUTE_UNUSED, } } -void polyfill_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect) +void polyfill_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect) { polyfill_color = SDL_MapRGB(canvas->format, r, g, b); @@ -533,15 +533,15 @@ void polyfill_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface } } -void polyfill_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * snapshot ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void polyfill_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *snapshot ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void polyfill_line_callback(void *pointer ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) +void polyfill_line_callback(void *pointer ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { SDL_Rect dest; @@ -554,8 +554,8 @@ void polyfill_line_callback(void *pointer ATTRIBUTE_UNUSED, int which ATTRIBUTE_ } -void polyfill_switchin(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas) +void polyfill_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas) { polyfill_color_red = SDL_MapRGB(canvas->format, 255, 0, 0); polyfill_color_green = SDL_MapRGB(canvas->format, 0, 255, 0); @@ -575,8 +575,8 @@ void polyfill_switchin(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU polyfill_active = 1; } -void polyfill_switchout(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas) +void polyfill_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas) { if (polyfill_num_pts > 0) { @@ -599,7 +599,7 @@ void polyfill_switchout(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN /* Based on public-domain code by Darel Rex Finley, 2007 https://alienryderflex.com/polygon_fill/ */ -void polyfill_draw_final(SDL_Surface * canvas) +void polyfill_draw_final(SDL_Surface *canvas) { int i, j, ymin, ymax, y, nodes, swap; int nodeX[256]; diff --git a/magic/src/puzzle.c b/magic/src/puzzle.c index a5a5f9d4e..19e6ecb04 100644 --- a/magic/src/puzzle.c +++ b/magic/src/puzzle.c @@ -83,7 +83,7 @@ Uint32 puzzle_api_version(void) return (TP_MAGIC_API_VERSION); } -int puzzle_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int puzzle_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -93,12 +93,12 @@ int puzzle_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return 1; } -int puzzle_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int puzzle_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 1; } -SDL_Surface *puzzle_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *puzzle_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -107,12 +107,12 @@ SDL_Surface *puzzle_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *puzzle_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *puzzle_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Puzzle"))); } -int puzzle_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int puzzle_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -124,35 +124,35 @@ int puzzle_get_order(int which ATTRIBUTE_UNUSED) } -char *puzzle_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *puzzle_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return strdup(gettext("Click the part of your picture where would you like a puzzle.")); return strdup(gettext("Click to make a puzzle in fullscreen mode.")); } -void puzzle_release(magic_api * api ATTRIBUTE_UNUSED, +void puzzle_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void puzzle_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void puzzle_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (puzzle_snd != NULL) Mix_FreeChunk(puzzle_snd); } -void puzzle_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void puzzle_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -int puzzle_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int puzzle_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } @@ -164,8 +164,8 @@ int gcd(int a, int b) //greatest common divisor return gcd(b, a % b); } -void puzzle_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void puzzle_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { puzzle_gcd = RATIO * gcd(canvas->w, canvas->h); rects_w = (unsigned int)canvas->w / puzzle_gcd; @@ -176,20 +176,20 @@ void puzzle_switchin(magic_api * api ATTRIBUTE_UNUSED, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask); } -void puzzle_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void puzzle_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { SDL_FreeSurface(canvas_backup); canvas_backup = NULL; } -int puzzle_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int puzzle_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } static void puzzle_draw(void *ptr, int which_tool ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { @@ -247,9 +247,9 @@ static void puzzle_draw(void *ptr, int which_tool ATTRIBUTE_UNUSED, } } -void puzzle_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox ATTRIBUTE_UNUSED, - int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void puzzle_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox ATTRIBUTE_UNUSED, + int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { puzzle_draw(api, which, canvas, last, x - puzzle_gcd / 2, y - puzzle_gcd / 2); @@ -264,25 +264,25 @@ void puzzle_drag(magic_api * api, int which, SDL_Surface * canvas, update_rect->w = canvas->w; } -void puzzle_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void puzzle_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { puzzle_drag(api, which, canvas, last, x, y, x, y, update_rect); } -Uint8 puzzle_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 puzzle_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 10; } -Uint8 puzzle_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 puzzle_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void puzzle_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void puzzle_set_size(magic_api *api, int which, int mode, SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { RATIO = size + 1; puzzle_switchin(api, which, mode, canvas); diff --git a/magic/src/rails.c b/magic/src/rails.c index feccfc3d6..625f2d55d 100644 --- a/magic/src/rails.c +++ b/magic/src/rails.c @@ -91,19 +91,19 @@ Uint32 rails_api_version(void) return (TP_MAGIC_API_VERSION); } -int rails_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rails_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -void rails_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void rails_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -int rails_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int rails_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; Uint8 i; //is always < 3, so Uint8 seems to be a good idea @@ -153,12 +153,12 @@ int rails_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int rails_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int rails_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 1; } -SDL_Surface *rails_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *rails_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -167,12 +167,12 @@ SDL_Surface *rails_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *rails_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *rails_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Rails")); } -int rails_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rails_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -182,25 +182,25 @@ int rails_get_order(int which ATTRIBUTE_UNUSED) return 2200; } -char *rails_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *rails_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext("Click and drag to draw train track rails on your picture.")); } -int rails_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rails_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void rails_release(magic_api * api ATTRIBUTE_UNUSED, +void rails_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void rails_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void rails_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Uint8 i; @@ -219,8 +219,8 @@ void rails_shutdown(magic_api * api ATTRIBUTE_UNUSED) free(rails_status_of_segments); } -void rails_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void rails_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { //we've to compute the quantity of segments in each direction @@ -236,8 +236,8 @@ void rails_switchin(magic_api * api ATTRIBUTE_UNUSED, rails_status_of_segments = (Uint8 *) calloc(rails_segments_x * rails_segments_y + 1, sizeof(Uint8)); } -void rails_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rails_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { if (rails_status_of_segments != NULL) { @@ -273,13 +273,13 @@ inline unsigned int rails_get_segment(int x, int y) } -inline void rails_extract_coords_from_segment(unsigned int segment, POINT_TYPE * x, POINT_TYPE * y) +inline void rails_extract_coords_from_segment(unsigned int segment, POINT_TYPE *x, POINT_TYPE *y) { //extracts the coords of the beginning and the segment *x = ((segment % rails_segments_x) - 1) * img_w; //useful to set update_rect as small as possible *y = (int)(segment / rails_segments_x) * img_h; } -static void rails_flip(void *ptr, SDL_Surface * dest, SDL_Surface * src) +static void rails_flip(void *ptr, SDL_Surface *dest, SDL_Surface *src) { magic_api *api = (magic_api *) ptr; POINT_TYPE x, y; @@ -289,7 +289,7 @@ static void rails_flip(void *ptr, SDL_Surface * dest, SDL_Surface * src) api->putpixel(dest, x, y, api->getpixel(src, x, src->h - y - 1)); } -static void rails_flip_flop(void *ptr, SDL_Surface * dest, SDL_Surface * src) +static void rails_flip_flop(void *ptr, SDL_Surface *dest, SDL_Surface *src) { magic_api *api = (magic_api *) ptr; POINT_TYPE x, y; @@ -299,7 +299,7 @@ static void rails_flip_flop(void *ptr, SDL_Surface * dest, SDL_Surface * src) api->putpixel(dest, x, y, api->getpixel(src, y, x)); } -static void rails_rotate(void *ptr, SDL_Surface * dest, SDL_Surface * src, unsigned int direction) +static void rails_rotate(void *ptr, SDL_Surface *dest, SDL_Surface *src, unsigned int direction) //src and dest must have same size { magic_api *api = (magic_api *) ptr; @@ -320,8 +320,8 @@ static void rails_rotate(void *ptr, SDL_Surface * dest, SDL_Surface * src, unsig } -void rails_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void rails_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { rails_segment_modified_last = 0; rails_drag(api, which, canvas, snapshot, x, y, x, y, update_rect); @@ -445,8 +445,8 @@ static Uint8 rails_select_image(Uint16 segment) } static void rails_draw(void *ptr, int which ATTRIBUTE_UNUSED, - ATTRIBUTE_UNUSED SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y ATTRIBUTE_UNUSED, unsigned int segment) + ATTRIBUTE_UNUSED SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y ATTRIBUTE_UNUSED, unsigned int segment) { magic_api *api = (magic_api *) ptr; SDL_Surface *result, *temp; @@ -551,7 +551,7 @@ static void rails_draw(void *ptr, int which ATTRIBUTE_UNUSED, api->playsound(rails_snd, (x * 255) / canvas->w, 255); } -static void rails_draw_wrapper(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void rails_draw_wrapper(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { rails_segment_modified = rails_get_segment(x, y); @@ -575,8 +575,8 @@ static void rails_draw_wrapper(void *ptr, int which, SDL_Surface * canvas, SDL_S rails_segment_modified_last = rails_segment_modified; } -void rails_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void rails_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { int start_x, end_x, start_y, end_y, segment_start, segment_end, w, h; @@ -608,18 +608,18 @@ void rails_drag(magic_api * api, int which, SDL_Surface * canvas, } -Uint8 rails_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rails_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 rails_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rails_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void rails_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void rails_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/rain.c b/magic/src/rain.c index 1c7e4a553..0e061825a 100644 --- a/magic/src/rain.c +++ b/magic/src/rain.c @@ -124,7 +124,7 @@ static int rain_inRainShape(double x, double y, double r) return 0; } -int rain_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int rain_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; @@ -140,13 +140,13 @@ int rain_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 c return (1); } -int rain_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int rain_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (rain_NUM_TOOLS); } // Load our icons: -SDL_Surface *rain_get_icon(magic_api * api, int which) +SDL_Surface *rain_get_icon(magic_api *api, int which) { char fname[1024]; @@ -155,13 +155,13 @@ SDL_Surface *rain_get_icon(magic_api * api, int which) } // Return our names, localized: -char *rain_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *rain_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(rain_names[which]))); } // Return our groups -int rain_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int rain_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { return rain_groups[which]; } @@ -173,14 +173,14 @@ int rain_get_order(int which) } // Return our descriptions, localized: -char *rain_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *rain_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return (strdup(gettext(rain_descs[which][mode - 1]))); } // Do the effect: static void do_rain_drop(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -204,7 +204,7 @@ static void do_rain_drop(void *ptr, int which ATTRIBUTE_UNUSED, } -static void rain_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void rain_linecb(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; SDL_Rect rect; @@ -217,8 +217,8 @@ static void rain_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surface } // Affect the canvas on drag: -void rain_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void rain_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, rain_linecb); @@ -244,8 +244,8 @@ void rain_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void rain_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void rain_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) @@ -279,16 +279,16 @@ void rain_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void rain_release(magic_api * api ATTRIBUTE_UNUSED, +void rain_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void rain_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void rain_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -303,49 +303,49 @@ void rain_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void rain_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, - Uint8 b ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void rain_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, + Uint8 b ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int rain_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rain_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void rain_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rain_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void rain_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rain_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int rain_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rain_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN | MODE_PAINT); } -Uint8 rain_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rain_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { /* Size affects both fullscreen and paint mode, in Rain tool! */ return 4; } -Uint8 rain_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rain_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void rain_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void rain_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { rain_SIZE = size * 15; rain_AMOUNT = 400 / size; diff --git a/magic/src/rainbow.c b/magic/src/rainbow.c index 01ae376a5..6abea738d 100644 --- a/magic/src/rainbow.c +++ b/magic/src/rainbow.c @@ -117,7 +117,7 @@ Uint32 rainbow_api_version(void) } // Load our sfx: -int rainbow_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int rainbow_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -132,13 +132,13 @@ int rainbow_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint } // We have multiple tools: -int rainbow_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int rainbow_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } // Load our icons: -SDL_Surface *rainbow_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *rainbow_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -148,7 +148,7 @@ SDL_Surface *rainbow_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *rainbow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *rainbow_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { /* FIXME: Place these in an array */ if (which == TOOL_RAINBOW) @@ -166,7 +166,7 @@ char *rainbow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU } // Return our group: -int rainbow_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rainbow_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -178,7 +178,7 @@ int rainbow_get_order(int which) } // Return our descriptions, localized: -char *rainbow_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *rainbow_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("You can draw in rainbow colors!"))); } @@ -186,7 +186,7 @@ char *rainbow_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIB // Do the effect: static void rainbow_linecb(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -204,8 +204,8 @@ static void rainbow_linecb(void *ptr, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void rainbow_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void rainbow_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { Uint8 r1, g1, b1, r2, g2, b2; int rc_tmp; @@ -271,8 +271,8 @@ void rainbow_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void rainbow_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void rainbow_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (which == TOOL_RAINBOW_CYCLE) { @@ -282,64 +282,64 @@ void rainbow_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, rainbow_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void rainbow_release(magic_api * api ATTRIBUTE_UNUSED, +void rainbow_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Clean up -void rainbow_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void rainbow_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (rainbow_snd != NULL) Mix_FreeChunk(rainbow_snd); } // Record the color from Tux Paint: -void rainbow_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void rainbow_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int rainbow_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rainbow_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void rainbow_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rainbow_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void rainbow_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rainbow_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int rainbow_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rainbow_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 rainbow_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rainbow_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 8; } -Uint8 rainbow_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rainbow_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void rainbow_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void rainbow_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { rainbow_radius = size * 4; } diff --git a/magic/src/realrainbow.c b/magic/src/realrainbow.c index d2cf0babd..57aeae88c 100644 --- a/magic/src/realrainbow.c +++ b/magic/src/realrainbow.c @@ -63,7 +63,7 @@ Uint32 realrainbow_api_version(void) return (TP_MAGIC_API_VERSION); } -int realrainbow_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int realrainbow_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -83,12 +83,12 @@ int realrainbow_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, return (1); } -int realrainbow_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int realrainbow_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (2); } -SDL_Surface *realrainbow_get_icon(magic_api * api, int which) +SDL_Surface *realrainbow_get_icon(magic_api *api, int which) { char fname[1024]; @@ -100,7 +100,7 @@ SDL_Surface *realrainbow_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *realrainbow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *realrainbow_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == 0) return (strdup(gettext("Real Rainbow"))); @@ -108,7 +108,7 @@ char *realrainbow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) return (strdup(gettext("ROYGBIV Rainbow"))); } -int realrainbow_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int realrainbow_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_ARTISTIC; } @@ -118,7 +118,7 @@ int realrainbow_get_order(int which) return 300 + which; } -char *realrainbow_get_description(magic_api * api ATTRIBUTE_UNUSED, +char *realrainbow_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup @@ -126,17 +126,17 @@ char *realrainbow_get_description(magic_api * api ATTRIBUTE_UNUSED, ("Click where you want your rainbow to start, drag to where you want it to end, and then let go to draw a rainbow."))); } -int realrainbow_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int realrainbow_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT_WITH_PREVIEW); } -int realrainbow_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int realrainbow_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (0); } -void realrainbow_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void realrainbow_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (realrainbow_colors[0] != NULL) SDL_FreeSurface(realrainbow_colors[0]); @@ -146,17 +146,17 @@ void realrainbow_shutdown(magic_api * api ATTRIBUTE_UNUSED) Mix_FreeChunk(realrainbow_snd); } -void realrainbow_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void realrainbow_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void realrainbow_click(magic_api * api ATTRIBUTE_UNUSED, +void realrainbow_click(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { realrainbow_x1 = x; realrainbow_y1 = y; @@ -167,9 +167,9 @@ void realrainbow_click(magic_api * api ATTRIBUTE_UNUSED, realrainbow_rect.h = 1; } -void realrainbow_drag(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, - int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void realrainbow_drag(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *last, + int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { int rx1, ry1, rx2, ry2; SDL_Rect rect; @@ -205,8 +205,8 @@ void realrainbow_drag(magic_api * api, int which, update_rect->h = ry2 - ry1 + 1; } -void realrainbow_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void realrainbow_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { int rx1, ry1, rx2, ry2; SDL_Rect rect; @@ -244,19 +244,19 @@ void realrainbow_release(magic_api * api, int which, api->playsound(realrainbow_snd, 128, 255); } -void realrainbow_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void realrainbow_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void realrainbow_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void realrainbow_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void realrainbow_arc(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int x1, int y1, int x2, int y2, int fulldraw, SDL_Rect * update_rect) +void realrainbow_arc(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int x1, int y1, int x2, int y2, int fulldraw, SDL_Rect *update_rect) { int lowx, lowy, hix, hiy, xm, ym, xc, yc, r, a1, atan2_a, atan2_b; int a, oa, ox, oy, nx, ny, step, thick, rr, done; @@ -375,7 +375,7 @@ void realrainbow_arc(magic_api * api, int which, SDL_Surface * canvas, } static void realrainbow_linecb(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y) + SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; Uint8 origr, origg, origb; @@ -391,19 +391,18 @@ static void realrainbow_linecb(void *ptr, int which ATTRIBUTE_UNUSED, } -Uint8 realrainbow_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED) +Uint8 realrainbow_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 realrainbow_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 realrainbow_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void realrainbow_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void realrainbow_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/reflection.c b/magic/src/reflection.c index df83ab11d..e5b9b0941 100644 --- a/magic/src/reflection.c +++ b/magic/src/reflection.c @@ -81,7 +81,7 @@ void reflection_set_size(magic_api * api, int which, int mode, SDL_Surface * can -int reflection_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int reflection_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -96,12 +96,12 @@ Uint32 reflection_api_version(void) return (TP_MAGIC_API_VERSION); } -int reflection_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int reflection_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *reflection_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *reflection_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -110,12 +110,12 @@ SDL_Surface *reflection_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *reflection_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *reflection_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Reflection"))); } -int reflection_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int reflection_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -125,21 +125,20 @@ int reflection_get_order(int which ATTRIBUTE_UNUSED) return 400; } -char *reflection_get_description(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *reflection_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag the mouse around to add a reflection to your picture."))); } -void reflection_drag(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, - int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void reflection_drag(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, + int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { do_reflection(api, canvas, last, x, y, update_rect, 1); } -void do_reflection(magic_api * api, SDL_Surface * canvas, - SDL_Surface * last, int x, int y, SDL_Rect * update_rect, int show_origin) +void do_reflection(magic_api *api, SDL_Surface *canvas, + SDL_Surface *last, int x, int y, SDL_Rect *update_rect, int show_origin) { float scale; int xx, yy; @@ -355,8 +354,8 @@ void do_reflection(magic_api * api, SDL_Surface * canvas, api->playsound(reflection_snd, (x * 255) / canvas->w, (y * 255) / canvas->h); } -void reflection_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void reflection_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (x <= 0) x = 1; @@ -375,60 +374,60 @@ void reflection_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, reflection_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void reflection_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void reflection_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { do_reflection(api, canvas, last, x, y, update_rect, 0); } -void reflection_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void reflection_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (reflection_snd != NULL) Mix_FreeChunk(reflection_snd); } -void reflection_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void reflection_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -int reflection_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int reflection_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void reflection_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void reflection_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { reflection_x1 = canvas->w / 2; reflection_y1 = canvas->h / 2; } -void reflection_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void reflection_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int reflection_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int reflection_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 reflection_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 reflection_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 reflection_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 reflection_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void reflection_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void reflection_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/ribbon.c b/magic/src/ribbon.c index fd843d9a6..33a5f2422 100644 --- a/magic/src/ribbon.c +++ b/magic/src/ribbon.c @@ -86,7 +86,7 @@ Uint32 ribbon_api_version(void) } // Load our sfx: -int ribbon_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int ribbon_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -97,13 +97,13 @@ int ribbon_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 } // We have multiple tools: -int ribbon_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int ribbon_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 1; } // Load our icons: -SDL_Surface *ribbon_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *ribbon_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -113,13 +113,13 @@ SDL_Surface *ribbon_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *ribbon_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *ribbon_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Ribbon"))); } // Return our group: -int ribbon_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ribbon_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -131,7 +131,7 @@ int ribbon_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *ribbon_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *ribbon_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Add a flowing ribbon to your picture."))); } @@ -139,7 +139,7 @@ char *ribbon_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU // Do the effect: static void ribbon_linecb(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int i; @@ -153,8 +153,8 @@ static void ribbon_linecb(void *ptr, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void ribbon_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void ribbon_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { int pt, pt2, first_click; Uint8 r, g, b; @@ -225,32 +225,32 @@ void ribbon_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void ribbon_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void ribbon_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { ribbon_head = ribbon_tail = ribbon_old_angle = 0; ribbon_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void ribbon_release(magic_api * api ATTRIBUTE_UNUSED, +void ribbon_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Clean up -void ribbon_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void ribbon_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (ribbon_snd != NULL) Mix_FreeChunk(ribbon_snd); } // Record the color from Tux Paint: -void ribbon_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void ribbon_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { ribbon_r = r; ribbon_g = g; @@ -258,40 +258,40 @@ void ribbon_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS } // Use colors: -int ribbon_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ribbon_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void ribbon_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void ribbon_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void ribbon_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void ribbon_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int ribbon_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ribbon_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 ribbon_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 ribbon_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return NUM_LENGTH_OPTIONS; } -Uint8 ribbon_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 ribbon_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (NUM_LENGTH_OPTIONS / 2); } -void ribbon_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void ribbon_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { ribbon_max_length = (size * MAX_LENGTH) / NUM_LENGTH_OPTIONS; } diff --git a/magic/src/ripples.c b/magic/src/ripples.c index dc6ae876c..4948d10ea 100644 --- a/magic/src/ripples.c +++ b/magic/src/ripples.c @@ -77,7 +77,7 @@ Uint32 ripples_api_version(void) #define deg_cos(x) cos((x) * M_PI / 180.0) #define deg_sin(x) sin((x) * M_PI / 180.0) -int ripples_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int ripples_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -87,13 +87,13 @@ int ripples_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint return (1); } -int ripples_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int ripples_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *ripples_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *ripples_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -103,13 +103,13 @@ SDL_Surface *ripples_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *ripples_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *ripples_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Ripples"))); } // Return our groups: -int ripples_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ripples_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -121,23 +121,22 @@ int ripples_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *ripples_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *ripples_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click to make ripples appear over your picture."))); } // Affect the canvas on drag: -void ripples_drag(magic_api * api ATTRIBUTE_UNUSED, +void ripples_drag(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -static void ripples_linecb(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void ripples_linecb(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; Uint8 r, g, b; @@ -154,8 +153,8 @@ static void ripples_linecb(void *ptr, int which ATTRIBUTE_UNUSED, } // Affect the canvas on click: -void ripples_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void ripples_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { float fli; int ox, oy, nx, ny, d; @@ -190,64 +189,64 @@ void ripples_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } // Affect the canvas on release: -void ripples_release(magic_api * api ATTRIBUTE_UNUSED, +void ripples_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void ripples_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void ripples_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (ripples_snd != NULL) Mix_FreeChunk(ripples_snd); } // Record the color from Tux Paint: -void ripples_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void ripples_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int ripples_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ripples_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void ripples_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void ripples_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void ripples_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void ripples_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int ripples_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int ripples_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_ONECLICK); } -Uint8 ripples_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 ripples_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 10; } -Uint8 ripples_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 ripples_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 5; } -void ripples_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void ripples_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { ripples_radius = ((float)size) * 20.0; } diff --git a/magic/src/rosette.c b/magic/src/rosette.c index 932dd7ce1..949e47c99 100644 --- a/magic/src/rosette.c +++ b/magic/src/rosette.c @@ -86,9 +86,9 @@ Uint32 rosette_api_version(void) return (TP_MAGIC_API_VERSION); } -void rosette_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void rosette_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { //get the colors from API and store it in structure rosette_colors.r = r; @@ -96,7 +96,7 @@ void rosette_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU rosette_colors.b = b; } -int rosette_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int rosette_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -106,12 +106,12 @@ int rosette_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint return (1); } -int rosette_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int rosette_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 2; } -SDL_Surface *rosette_get_icon(magic_api * api, int which) +SDL_Surface *rosette_get_icon(magic_api *api, int which) { char fname[1024]; @@ -123,7 +123,7 @@ SDL_Surface *rosette_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *rosette_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *rosette_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (!which) return strdup(gettext("Rosette")); @@ -131,7 +131,7 @@ char *rosette_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) return strdup(gettext("Picasso")); } -int rosette_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rosette_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PATTERN_PAINTING; } @@ -141,28 +141,28 @@ int rosette_get_order(int which) return 200 + which; } -char *rosette_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *rosette_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (!which) - return strdup(gettext("Click and start drawing your rosette.")); //just k'scope with 3 bits? + return strdup(gettext("Click and start drawing your rosette.")); //just k'scope with 3 bits? else - return strdup(gettext("You can draw just like Picasso!")); //what is this actually doing? + return strdup(gettext("You can draw just like Picasso!")); //what is this actually doing? } -int rosette_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rosette_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void rosette_release(magic_api * api ATTRIBUTE_UNUSED, +void rosette_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void rosette_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void rosette_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(rosette_snd); } @@ -170,7 +170,7 @@ void rosette_shutdown(magic_api * api ATTRIBUTE_UNUSED) // Interactivity functions void rosette_circle(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -183,7 +183,7 @@ void rosette_circle(void *ptr, int which ATTRIBUTE_UNUSED, } -void rosette_draw(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y) +void rosette_draw(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -232,8 +232,8 @@ void rosette_draw(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * snap rosette_circle(api, which, canvas, snapshot, (-1) * (x2 - xmid), y2 + ymid); } -void rosette_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void rosette_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, snapshot, ox, oy, x, y, 1, rosette_draw); api->playsound(rosette_snd, (x * 255) / canvas->w, 255); @@ -243,44 +243,44 @@ void rosette_drag(magic_api * api, int which, SDL_Surface * canvas, update_rect->h = canvas->h; } -void rosette_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void rosette_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { rosette_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void rosette_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rosette_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { xmid = canvas->w / 2; ymid = canvas->h / 2; } -void rosette_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rosette_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int rosette_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rosette_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 rosette_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rosette_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -Uint8 rosette_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rosette_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 1; } -void rosette_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void rosette_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { ROSETTE_R = (size + 2) * 2; } diff --git a/magic/src/rotate.c b/magic/src/rotate.c index bfdbe97eb..e0a87cdd1 100644 --- a/magic/src/rotate.c +++ b/magic/src/rotate.c @@ -33,7 +33,7 @@ #include "SDL2_rotozoom.h" static Mix_Chunk *rotate_snd_drag, *rotate_snd_release; -SDL_Surface * rotate_snapshot = NULL; +SDL_Surface *rotate_snapshot = NULL; Uint32 rotate_color; float rotate_last_angle = 0.0; int rotate_clicked_since_switchin = 0; @@ -48,17 +48,17 @@ int rotate_get_order(int which); char *rotate_get_description(magic_api * api, int which, int mode); void rotate_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); + SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); void rotate_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void rotate_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void rotate_shutdown(magic_api * api); void rotate_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); + SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); int rotate_requires_colors(magic_api * api, int which); void rotate_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void rotate_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas); @@ -66,7 +66,7 @@ int rotate_modes(magic_api * api, int which); Uint8 rotate_accepted_sizes(magic_api * api, int which, int mode); Uint8 rotate_default_size(magic_api * api, int which, int mode); void rotate_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, - SDL_Rect * update_rect); + SDL_Rect * update_rect); float do_rotate(SDL_Surface * canvas, int x, int y, int smoothing_flag); void rotate_xorline_callback(void *pointer, int tool, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y); @@ -76,7 +76,7 @@ Uint32 rotate_api_version(void) return (TP_MAGIC_API_VERSION); } -int rotate_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int rotate_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -89,12 +89,12 @@ int rotate_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int rotate_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int rotate_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *rotate_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *rotate_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -103,12 +103,12 @@ SDL_Surface *rotate_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *rotate_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *rotate_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Rotate"))); } -int rotate_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rotate_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -118,19 +118,19 @@ int rotate_get_order(int which ATTRIBUTE_UNUSED) return 900; } -char *rotate_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *rotate_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag to rotate your drawing."))); } -float do_rotate(SDL_Surface * canvas, int x, int y, int smoothing_flag) +float do_rotate(SDL_Surface *canvas, int x, int y, int smoothing_flag) { - SDL_Surface * new_surf; + SDL_Surface *new_surf; float angle_rad; SDL_Rect dest; if (rotate_snapshot == NULL) - return 0.0; /* abort! */ + return 0.0; /* abort! */ /* Render a rotated version of the snapshot */ /* ---------------------------------------- */ @@ -140,7 +140,7 @@ float do_rotate(SDL_Surface * canvas, int x, int y, int smoothing_flag) (allows you to click a spot, and while rotating it remains under the pointer; versus always re-rotating) */ angle_rad += rotate_last_angle; - new_surf = rotozoomSurface(rotate_snapshot, (angle_rad * 180.0 / M_PI), 1.0 /* no zoom */, smoothing_flag); + new_surf = rotozoomSurface(rotate_snapshot, (angle_rad * 180.0 / M_PI), 1.0 /* no zoom */ , smoothing_flag); /* Draw background color on canvas */ /* ------------------------------- */ @@ -159,16 +159,16 @@ float do_rotate(SDL_Surface * canvas, int x, int y, int smoothing_flag) } void rotate_xorline_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) pointer; api->xorpixel(canvas, x, y); } -void rotate_drag(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, - int x, int y, SDL_Rect * update_rect) +void rotate_drag(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, + int x, int y, SDL_Rect *update_rect) { float ang; int xx, yy; @@ -177,15 +177,13 @@ void rotate_drag(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canv ang = do_rotate(canvas, x, y, SMOOTHING_OFF); /* Draw indicator lines */ - xx = (canvas->w / 2) + ((int) (cos(ang) * 100)); - yy = (canvas->h / 2) - ((int) (sin(ang) * 100)); - api->line((void *)api, which, canvas, last, canvas->w / 2, canvas->h / 2, xx, yy, 1, - rotate_xorline_callback); + xx = (canvas->w / 2) + ((int)(cos(ang) * 100)); + yy = (canvas->h / 2) - ((int)(sin(ang) * 100)); + api->line((void *)api, which, canvas, last, canvas->w / 2, canvas->h / 2, xx, yy, 1, rotate_xorline_callback); - xx = (canvas->w / 2) + ((int) (cos(ang + (M_PI / 2)) * 200)); - yy = (canvas->h / 2) - ((int) (sin(ang + (M_PI / 2)) * 200)); - api->line((void *)api, which, canvas, last, canvas->w / 2, canvas->h / 2, xx, yy, 1, - rotate_xorline_callback); + xx = (canvas->w / 2) + ((int)(cos(ang + (M_PI / 2)) * 200)); + yy = (canvas->h / 2) - ((int)(sin(ang + (M_PI / 2)) * 200)); + api->line((void *)api, which, canvas, last, canvas->w / 2, canvas->h / 2, xx, yy, 1, rotate_xorline_callback); update_rect->x = 0; update_rect->y = 0; @@ -195,8 +193,8 @@ void rotate_drag(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canv api->playsound(rotate_snd_drag, 128, 255); } -void rotate_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void rotate_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { /* Calculate the starting angle as the OPPOSITE of * where you clicked (so that `rotate_drag()` ends up @@ -217,9 +215,8 @@ void rotate_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, rotate_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void rotate_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void rotate_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { /* Final rotation work; and now, record the final angle * we landed at, so we can reuse it -- both for stacking up @@ -238,7 +235,7 @@ void rotate_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED api->playsound(rotate_snd_release, 128, 255); } -void rotate_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void rotate_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (rotate_snd_drag != NULL) Mix_FreeChunk(rotate_snd_drag); @@ -253,8 +250,8 @@ void rotate_shutdown(magic_api * api ATTRIBUTE_UNUSED) } } -void rotate_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect) +void rotate_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect) { /* Record the new color */ rotate_color = SDL_MapRGB(canvas->format, r, g, b); @@ -273,13 +270,13 @@ void rotate_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS } } -int rotate_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rotate_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void rotate_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void rotate_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { if (rotate_snapshot == NULL) rotate_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h, @@ -297,8 +294,8 @@ void rotate_switchin(magic_api * api ATTRIBUTE_UNUSED, rotate_last_angle = 0.0; } -void rotate_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void rotate_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { /* Since `set_color()` gets called _before_ `switchin()` * we need to clear this flag on our way out, so we don't @@ -309,24 +306,24 @@ void rotate_switchout(magic_api * api ATTRIBUTE_UNUSED, rotate_clicked_since_switchin = 0; } -int rotate_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int rotate_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 rotate_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rotate_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 rotate_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 rotate_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void rotate_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void rotate_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/sharpen.c b/magic/src/sharpen.c index 1996232a0..dc8d52e9e 100644 --- a/magic/src/sharpen.c +++ b/magic/src/sharpen.c @@ -133,7 +133,7 @@ Uint32 sharpen_api_version(void) // No setup required: -int sharpen_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int sharpen_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; @@ -149,13 +149,13 @@ int sharpen_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint } // We have multiple tools: -int sharpen_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int sharpen_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (sharpen_NUM_TOOLS); } // Load our icons: -SDL_Surface *sharpen_get_icon(magic_api * api, int which) +SDL_Surface *sharpen_get_icon(magic_api *api, int which) { char fname[1024]; @@ -164,13 +164,13 @@ SDL_Surface *sharpen_get_icon(magic_api * api, int which) } // Return our names, localized: -char *sharpen_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *sharpen_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(sharpen_names[which]))); } // Return our group (all the same): -int sharpen_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int sharpen_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -182,7 +182,7 @@ int sharpen_get_order(int which) } // Return our descriptions, localized: -char *sharpen_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *sharpen_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return (strdup(gettext(sharpen_descs[which][mode - 1]))); } @@ -194,7 +194,7 @@ static int sharpen_grey(Uint8 r1, Uint8 g1, Uint8 b1) } // Do the effect: -static void do_sharpen_pixel(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_sharpen_pixel(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -256,7 +256,7 @@ static void do_sharpen_pixel(void *ptr, int which, SDL_Surface * canvas, SDL_Sur } // Do the effect for the full image -static void do_sharpen_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) +static void do_sharpen_full(void *ptr, SDL_Surface *canvas, SDL_Surface *last, int which) { magic_api *api = (magic_api *) ptr; @@ -277,7 +277,7 @@ static void do_sharpen_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, } //do the effect for the brush -static void do_sharpen_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_sharpen_brush(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { int xx, yy; magic_api *api = (magic_api *) ptr; @@ -295,8 +295,8 @@ static void do_sharpen_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Sur } // Affect the canvas on drag: -void sharpen_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void sharpen_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_sharpen_brush); @@ -325,8 +325,8 @@ void sharpen_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void sharpen_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void sharpen_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) sharpen_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -342,16 +342,16 @@ void sharpen_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void sharpen_release(magic_api * api ATTRIBUTE_UNUSED, +void sharpen_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void sharpen_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void sharpen_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -366,37 +366,37 @@ void sharpen_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void sharpen_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void sharpen_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int sharpen_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int sharpen_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void sharpen_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void sharpen_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void sharpen_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void sharpen_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int sharpen_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int sharpen_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN | MODE_PAINT); } -Uint8 sharpen_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 sharpen_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { if (mode == MODE_PAINT) return 8; @@ -404,14 +404,14 @@ Uint8 sharpen_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU return 0; } -Uint8 sharpen_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 sharpen_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void sharpen_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void sharpen_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { sharpen_RADIUS = size * 4; } diff --git a/magic/src/shift.c b/magic/src/shift.c index 433ca4fe0..ecb5ad850 100644 --- a/magic/src/shift.c +++ b/magic/src/shift.c @@ -81,7 +81,7 @@ Uint32 shift_api_version(void) // No setup required: -int shift_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int shift_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -92,13 +92,13 @@ int shift_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 } // We have multiple tools: -int shift_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int shift_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *shift_get_icon(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +SDL_Surface *shift_get_icon(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -108,13 +108,13 @@ SDL_Surface *shift_get_icon(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT } // Return our names, localized: -char *shift_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *shift_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Shift"))); } // Return our group -int shift_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int shift_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -126,15 +126,15 @@ int shift_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *shift_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *shift_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag to shift your picture around on the canvas."))); } // Affect the canvas on drag: -void shift_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void shift_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { if (ox == x && oy == y) return; /* No-op */ @@ -142,10 +142,10 @@ void shift_drag(magic_api * api, int which, SDL_Surface * canvas, shift_doit(api, which, canvas, last, ox, oy, x, y, update_rect, 1); } -static void shift_doit(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last, int ox ATTRIBUTE_UNUSED, - int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect, int crosshairs) +static void shift_doit(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last, int ox ATTRIBUTE_UNUSED, + int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect, int crosshairs) { SDL_Rect dest; int dx, dy; @@ -305,8 +305,8 @@ static void shift_doit(magic_api * api ATTRIBUTE_UNUSED, } // Affect the canvas on click: -void shift_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void shift_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { shift_x = x; shift_y = y; @@ -315,8 +315,8 @@ void shift_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } // Affect the canvas on release: -void shift_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void shift_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { shift_doit(api, which, canvas, last, x, y, x, y, update_rect, 0); api->stopsound(); @@ -324,54 +324,54 @@ void shift_release(magic_api * api, int which, // No setup happened: -void shift_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void shift_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (shift_snd != NULL) Mix_FreeChunk(shift_snd); } // Record the color from Tux Paint: -void shift_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void shift_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int shift_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int shift_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void shift_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void shift_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void shift_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void shift_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int shift_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int shift_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT_WITH_PREVIEW); } -Uint8 shift_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 shift_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 shift_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 shift_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void shift_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void shift_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/smooth.c b/magic/src/smooth.c index 04f4a7f6a..57106b1e5 100644 --- a/magic/src/smooth.c +++ b/magic/src/smooth.c @@ -127,7 +127,7 @@ void smooth_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, -int smooth_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int smooth_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; int i; @@ -147,13 +147,13 @@ Uint32 smooth_api_version(void) } // Only one tool: -int smooth_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int smooth_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } // Load our icon: -SDL_Surface *smooth_get_icon(magic_api * api, int which) +SDL_Surface *smooth_get_icon(magic_api *api, int which) { char fname[1024]; @@ -162,13 +162,13 @@ SDL_Surface *smooth_get_icon(magic_api * api, int which) } // Return our name, localized: -char *smooth_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *smooth_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(smooth_names[which]))); } // Return our group -int smooth_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int smooth_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -180,13 +180,13 @@ int smooth_get_order(int which) } // Return our description, localized: -char *smooth_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *smooth_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext(smooth_descrs[which]))); } -static void smooth_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) +static void smooth_linecb(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; SDL_Rect dest; @@ -220,7 +220,7 @@ static void smooth_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surfac #define LOOP_RAD_CALC (smooth_size * 10) static void smooth_squiggle_linecb(void *ptr, int which, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx1, yy1, xx2, yy2, i; @@ -264,8 +264,8 @@ static void smooth_squiggle_linecb(void *ptr, int which, } } -void smooth_drag(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void smooth_drag(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { if (which == TOOL_SMOOTH) { @@ -335,9 +335,9 @@ void smooth_drag(magic_api * api, int which, api->playsound(smooth_snds[which], (x * 255) / canvas->w, 255); } -void smooth_click(magic_api * api, +void smooth_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { num_input_points = 0; smooth_control_points[num_input_points].x = x; @@ -359,9 +359,9 @@ void smooth_click(magic_api * api, } -void smooth_release(magic_api * api, +void smooth_release(magic_api *api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (which == TOOL_SMOOTH) { @@ -418,7 +418,7 @@ void smooth_release(magic_api * api, } -void smooth_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void smooth_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -429,15 +429,15 @@ void smooth_shutdown(magic_api * api ATTRIBUTE_UNUSED) } } -void smooth_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void smooth_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { smooth_color = SDL_MapRGB(canvas->format, r, g, b); } -int smooth_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int smooth_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } @@ -456,7 +456,7 @@ cp[3] is the end point, or P3 in the above diagram t is the parameter value, 0 <= t <= 1 */ -static Point2D smooth_PointOnCubicBezier(Point2D * cp, float t) +static Point2D smooth_PointOnCubicBezier(Point2D *cp, float t) { float ax, bx, cx; float ay, by, cy; @@ -492,7 +492,7 @@ static Point2D smooth_PointOnCubicBezier(Point2D * cp, float t) */ -static void smooth_ComputeBezier(Point2D * cp, int numberOfPoints, Point2D * curve) +static void smooth_ComputeBezier(Point2D *cp, int numberOfPoints, Point2D *curve) { float dt; int i; @@ -512,35 +512,35 @@ static float smooth_dist(float x1, float y1, float x2, float y2) return d; } -void smooth_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void smooth_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void smooth_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void smooth_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int smooth_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int smooth_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 smooth_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +Uint8 smooth_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return smooth_sizes[which]; } -Uint8 smooth_default_size(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +Uint8 smooth_default_size(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return smooth_sizes[which] / 2; } -void smooth_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void smooth_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { smooth_size = size; } diff --git a/magic/src/smudge.c b/magic/src/smudge.c index b60713490..16461e80e 100644 --- a/magic/src/smudge.c +++ b/magic/src/smudge.c @@ -70,7 +70,7 @@ void smudge_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Rect * update_rect); -int smudge_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int smudge_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -86,13 +86,13 @@ Uint32 smudge_api_version(void) } // We have multiple tools: -int smudge_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int smudge_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (2); } // Load our icons: -SDL_Surface *smudge_get_icon(magic_api * api, int which) +SDL_Surface *smudge_get_icon(magic_api *api, int which) { char fname[1024]; @@ -105,7 +105,7 @@ SDL_Surface *smudge_get_icon(magic_api * api, int which) } // Return our names, localized: -char *smudge_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *smudge_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == 0) return (strdup(gettext("Smudge"))); @@ -114,7 +114,7 @@ char *smudge_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) } // Return our groups -int smudge_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int smudge_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == 0) return MAGIC_TYPE_DISTORTS; /* Smudge */ @@ -132,7 +132,7 @@ int smudge_get_order(int which) } // Return our descriptions, localized: -char *smudge_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *smudge_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (which == 0) return (strdup(gettext("Click and drag the mouse around to smudge the picture."))); @@ -142,7 +142,7 @@ char *smudge_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mo // Do the effect: -static void do_smudge(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_smudge(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; static double state[256][256][3]; @@ -197,8 +197,8 @@ static void do_smudge(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * } // Affect the canvas on drag: -void smudge_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void smudge_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_smudge); @@ -226,32 +226,32 @@ void smudge_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void smudge_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void smudge_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { smudge_drag(api, which, canvas, last, x, y, x, y, update_rect); } // Affect the canvas on click: -void smudge_release(magic_api * api ATTRIBUTE_UNUSED, +void smudge_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void smudge_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void smudge_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (smudge_snd != NULL) Mix_FreeChunk(smudge_snd); } // Record the color from Tux Paint: -void smudge_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void smudge_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { smudge_r = r; smudge_g = g; @@ -259,7 +259,7 @@ void smudge_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS } // Use colors: -int smudge_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int smudge_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { if (which == 0) return 0; @@ -267,36 +267,36 @@ int smudge_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE return 1; } -void smudge_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void smudge_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void smudge_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void smudge_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int smudge_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int smudge_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 smudge_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 smudge_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 8; } -Uint8 smudge_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 smudge_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void smudge_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void smudge_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { smudge_radius = size * 4; } diff --git a/magic/src/snow.c b/magic/src/snow.c index 1e4d45e1a..5ad0a8dd2 100644 --- a/magic/src/snow.c +++ b/magic/src/snow.c @@ -117,7 +117,7 @@ Uint32 snow_api_version(void) } //Load sounds -int snow_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int snow_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; @@ -147,13 +147,13 @@ int snow_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 c return (1); } -int snow_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int snow_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (snow_NUM_TOOLS); } // Load our icons: -SDL_Surface *snow_get_icon(magic_api * api, int which) +SDL_Surface *snow_get_icon(magic_api *api, int which) { char fname[1024]; @@ -162,12 +162,12 @@ SDL_Surface *snow_get_icon(magic_api * api, int which) } // Return our names, localized: -char *snow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *snow_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(snow_names[which]))); } -int snow_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int snow_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_DECORATIONS; /* Because we affect the whole image, and not just around the mouse */ } @@ -178,13 +178,13 @@ int snow_get_order(int which) } // Return our descriptions, localized: -char *snow_get_description(magic_api * api ATTRIBUTE_UNUSED, int which) +char *snow_get_description(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(snow_descs[which]))); } // Do the effect: -static void do_snow(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which, int snowAmount) +static void do_snow(void *ptr, SDL_Surface *canvas, SDL_Surface *last, int which, int snowAmount) { magic_api *api = (magic_api *) ptr; @@ -227,19 +227,19 @@ static void do_snow(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int whi } // Affect the canvas on drag: -void snow_drag(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int ox ATTRIBUTE_UNUSED, +void snow_drag(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { // No-op } // Affect the canvas on click: -void snow_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect) +void snow_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect) { update_rect->x = 0; update_rect->y = 0; @@ -251,16 +251,16 @@ void snow_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } // Affect the canvas on release: -void snow_release(magic_api * api ATTRIBUTE_UNUSED, +void snow_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void snow_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void snow_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -283,47 +283,47 @@ void snow_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void snow_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, - Uint8 b ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void snow_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, + Uint8 b ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int snow_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int snow_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void snow_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void snow_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void snow_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void snow_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int snow_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int snow_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN); } -Uint8 snow_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 snow_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { /* FIXME: Support sizes */ return 0; } -Uint8 snow_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 snow_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void snow_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void snow_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/spiral.c b/magic/src/spiral.c index f13e323f6..78dd6a771 100644 --- a/magic/src/spiral.c +++ b/magic/src/spiral.c @@ -33,7 +33,8 @@ #include "SDL_image.h" #include "SDL_mixer.h" -enum { +enum +{ TOOL_SPIRAL_CIRCLE, TOOL_SPIRAL_SQUARE, TOOL_CONCENTRIC_CIRCLE, @@ -41,28 +42,28 @@ enum { NUM_TOOLS }; -const char * spiral_names[NUM_TOOLS] = { +const char *spiral_names[NUM_TOOLS] = { gettext_noop("Spiral"), gettext_noop("Square Spiral"), gettext_noop("Concentric Circles"), gettext_noop("Concentric Squares"), }; -const char * spiral_descrs[NUM_TOOLS] = { +const char *spiral_descrs[NUM_TOOLS] = { gettext_noop("Click and drag to create a spiral."), gettext_noop("Click and drag to create a square spiral."), gettext_noop("Click and drag to create concentric circles."), gettext_noop("Click and drag to create concentric squares."), }; -const char * spiral_sounds[NUM_TOOLS] = { +const char *spiral_sounds[NUM_TOOLS] = { "spiral-circle.ogg", "spiral-square.ogg", "concentric-circle.ogg", "concentric-square.ogg", }; -const char * spiral_icons[NUM_TOOLS] = { +const char *spiral_icons[NUM_TOOLS] = { "spiral-circle.png", "spiral-square.png", "concentric-circle.png", @@ -94,17 +95,17 @@ int spiral_get_order(int which); char *spiral_get_description(magic_api * api, int which, int mode); void spiral_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); + SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); void spiral_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void spiral_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void spiral_shutdown(magic_api * api); void spiral_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); + SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); int spiral_requires_colors(magic_api * api, int which); void spiral_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void spiral_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas); @@ -112,18 +113,17 @@ int spiral_modes(magic_api * api, int which); Uint8 spiral_accepted_sizes(magic_api * api, int which, int mode); Uint8 spiral_default_size(magic_api * api, int which, int mode); void spiral_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, - SDL_Rect * update_rect); + SDL_Rect * update_rect); void do_spiral(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int x, int y, SDL_Rect * update_rect, - int final); + SDL_Surface * last, int x, int y, SDL_Rect * update_rect, int final); Uint32 spiral_api_version(void) { return (TP_MAGIC_API_VERSION); } -int spiral_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int spiral_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; int i; @@ -137,12 +137,12 @@ int spiral_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int spiral_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int spiral_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } -SDL_Surface *spiral_get_icon(magic_api * api, int which) +SDL_Surface *spiral_get_icon(magic_api *api, int which) { char fname[1024]; @@ -151,12 +151,12 @@ SDL_Surface *spiral_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *spiral_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *spiral_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext(spiral_names[which]))); } -int spiral_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int spiral_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -166,13 +166,13 @@ int spiral_get_order(int which) return 1310 + which; } -char *spiral_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *spiral_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext(spiral_descrs[which]))); } static void do_spiral_render(void *ptr, int which, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; SDL_Rect dest; @@ -200,9 +200,8 @@ static void do_spiral_render(void *ptr, int which, } } -void do_spiral(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int x, int y, SDL_Rect * update_rect, - int final) +void do_spiral(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int x, int y, SDL_Rect *update_rect, int final) { float radius = 0, i, xx, yy, xsgn, ysgn, stp, oxx, oyy; int vol; @@ -237,16 +236,15 @@ void do_spiral(magic_api * api, int which, SDL_Surface * canvas, yy = (i * sin((i * (ITER / spiral_thickness)) / 180.0 * M_PI)) * ysgn; if (final) { - api->line((void *) api, which, canvas, NULL, - ((int) oxx) + spiral_cx, ((int) oyy) + spiral_cy, - ((int) xx) + spiral_cx, ((int) yy) + spiral_cy, - 1, do_spiral_render); + api->line((void *)api, which, canvas, NULL, + ((int)oxx) + spiral_cx, ((int)oyy) + spiral_cy, + ((int)xx) + spiral_cx, ((int)yy) + spiral_cy, 1, do_spiral_render); oxx = xx; oyy = yy; } else { - do_spiral_render(api, which, canvas, NULL, ((int) xx) + spiral_cx, ((int) yy) + spiral_cy); + do_spiral_render(api, which, canvas, NULL, ((int)xx) + spiral_cx, ((int)yy) + spiral_cy); } } } @@ -261,26 +259,22 @@ void do_spiral(magic_api * api, int which, SDL_Surface * canvas, oi = 0; for (i = spiral_thickness; i < radius; i += spiral_thickness * 2) { - if (dir == 0) // right - api->line((void *) api, which, canvas, NULL, + if (dir == 0) // right + api->line((void *)api, which, canvas, NULL, spiral_cx - (ooi * xsgn), spiral_cy - (oi * ysgn), - spiral_cx + (i * xsgn), spiral_cy - (oi * ysgn), - 1, do_spiral_render); - else if (dir == 1) // down - api->line((void *) api, which, canvas, NULL, + spiral_cx + (i * xsgn), spiral_cy - (oi * ysgn), 1, do_spiral_render); + else if (dir == 1) // down + api->line((void *)api, which, canvas, NULL, spiral_cx + (oi * xsgn), spiral_cy - (ooi * ysgn), - spiral_cx + (oi * xsgn), spiral_cy + (i * ysgn), - 1, do_spiral_render); - else if (dir == 2) // left - api->line((void *) api, which, canvas, NULL, + spiral_cx + (oi * xsgn), spiral_cy + (i * ysgn), 1, do_spiral_render); + else if (dir == 2) // left + api->line((void *)api, which, canvas, NULL, spiral_cx + (ooi * xsgn), spiral_cy + (oi * ysgn), - spiral_cx - (i * xsgn), spiral_cy + (oi * ysgn), - 1, do_spiral_render); - else if (dir == 3) // up - api->line((void *) api, which, canvas, NULL, + spiral_cx - (i * xsgn), spiral_cy + (oi * ysgn), 1, do_spiral_render); + else if (dir == 3) // up + api->line((void *)api, which, canvas, NULL, spiral_cx - (oi * xsgn), spiral_cy + (ooi * ysgn), - spiral_cx - (oi * xsgn), spiral_cy - (i * ysgn), - 1, do_spiral_render); + spiral_cx - (oi * xsgn), spiral_cy - (i * ysgn), 1, do_spiral_render); dir = (dir + 1) % 4; @@ -309,16 +303,15 @@ void do_spiral(magic_api * api, int which, SDL_Surface * canvas, yy = (i * sin(ang / 180.0 * M_PI)); if (final) { - api->line((void *) api, which, canvas, NULL, - ((int) oxx) + spiral_cx, ((int) oyy) + spiral_cy, - ((int) xx) + spiral_cx, ((int) yy) + spiral_cy, - 1, do_spiral_render); + api->line((void *)api, which, canvas, NULL, + ((int)oxx) + spiral_cx, ((int)oyy) + spiral_cy, + ((int)xx) + spiral_cx, ((int)yy) + spiral_cy, 1, do_spiral_render); oxx = xx; oyy = yy; } else { - do_spiral_render(api, which, canvas, NULL, ((int) xx) + spiral_cx, ((int) yy) + spiral_cy); + do_spiral_render(api, which, canvas, NULL, ((int)xx) + spiral_cx, ((int)yy) + spiral_cy); } } } @@ -329,22 +322,14 @@ void do_spiral(magic_api * api, int which, SDL_Surface * canvas, for (i = spiral_thickness; i < radius; i += spiral_thickness * 8) { - api->line((void *) api, which, canvas, NULL, - spiral_cx - i, spiral_cy - i, - spiral_cx + i, spiral_cy - i, - 1, do_spiral_render); - api->line((void *) api, which, canvas, NULL, - spiral_cx + i, spiral_cy - i, - spiral_cx + i, spiral_cy + i, - 1, do_spiral_render); - api->line((void *) api, which, canvas, NULL, - spiral_cx + i, spiral_cy + i, - spiral_cx - i, spiral_cy + i, - 1, do_spiral_render); - api->line((void *) api, which, canvas, NULL, - spiral_cx - i, spiral_cy + i, - spiral_cx - i, spiral_cy - i, - 1, do_spiral_render); + api->line((void *)api, which, canvas, NULL, + spiral_cx - i, spiral_cy - i, spiral_cx + i, spiral_cy - i, 1, do_spiral_render); + api->line((void *)api, which, canvas, NULL, + spiral_cx + i, spiral_cy - i, spiral_cx + i, spiral_cy + i, 1, do_spiral_render); + api->line((void *)api, which, canvas, NULL, + spiral_cx + i, spiral_cy + i, spiral_cx - i, spiral_cy + i, 1, do_spiral_render); + api->line((void *)api, which, canvas, NULL, + spiral_cx - i, spiral_cy + i, spiral_cx - i, spiral_cy - i, 1, do_spiral_render); } } @@ -363,15 +348,16 @@ void do_spiral(magic_api * api, int which, SDL_Surface * canvas, api->playsound(spiral_snd[which], (spiral_cx * 255) / canvas->w, vol); } -void spiral_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void spiral_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, + SDL_Rect *update_rect) { spiral_has_dragged = 1; do_spiral(api, which, canvas, last, x, y, update_rect, 0); } -void spiral_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void spiral_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { spiral_cx = x; spiral_cy = y; @@ -382,10 +368,8 @@ void spiral_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, spiral_has_dragged = 0; } -void spiral_release(magic_api * api, int which, - SDL_Surface * canvas, - SDL_Surface * last , int x, - int y, SDL_Rect * update_rect) +void spiral_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { float radius; @@ -396,7 +380,7 @@ void spiral_release(magic_api * api, int which, do_spiral(api, which, canvas, last, x, y, update_rect, 1); } -void spiral_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void spiral_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -405,46 +389,47 @@ void spiral_shutdown(magic_api * api ATTRIBUTE_UNUSED) Mix_FreeChunk(spiral_snd[i]); } -void spiral_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void spiral_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { spiral_color = SDL_MapRGB(canvas->format, r, g, b); } -int spiral_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int spiral_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void spiral_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void spiral_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void spiral_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void spiral_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int spiral_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int spiral_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 spiral_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 spiral_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 8; } -Uint8 spiral_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 spiral_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void spiral_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void spiral_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { spiral_thickness = size; } diff --git a/magic/src/spraypaint.c b/magic/src/spraypaint.c index 93455a314..e89650ded 100644 --- a/magic/src/spraypaint.c +++ b/magic/src/spraypaint.c @@ -46,17 +46,17 @@ int spraypaint_get_order(int which); char *spraypaint_get_description(magic_api * api, int which, int mode); void spraypaint_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); + SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); void spraypaint_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void spraypaint_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void spraypaint_shutdown(magic_api * api); void spraypaint_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); + SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); int spraypaint_requires_colors(magic_api * api, int which); void spraypaint_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void spraypaint_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas); @@ -64,7 +64,7 @@ int spraypaint_modes(magic_api * api, int which); Uint8 spraypaint_accepted_sizes(magic_api * api, int which, int mode); Uint8 spraypaint_default_size(magic_api * api, int which, int mode); void spraypaint_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, - SDL_Rect * update_rect); + SDL_Rect * update_rect); Uint32 spraypaint_api_version(void) @@ -72,7 +72,7 @@ Uint32 spraypaint_api_version(void) return (TP_MAGIC_API_VERSION); } -int spraypaint_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int spraypaint_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -85,12 +85,12 @@ int spraypaint_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, U return (1); } -int spraypaint_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int spraypaint_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *spraypaint_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *spraypaint_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -99,12 +99,12 @@ SDL_Surface *spraypaint_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *spraypaint_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *spraypaint_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Spray Paint"))); } -int spraypaint_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int spraypaint_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PAINTING; } @@ -114,12 +114,12 @@ int spraypaint_get_order(int which ATTRIBUTE_UNUSED) return 800; } -char *spraypaint_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *spraypaint_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag to add a random spray of color onto your image."))); } -static void do_spraypaint(magic_api * api, SDL_Surface * canvas, int x, int y, int max_intensity) +static void do_spraypaint(magic_api *api, SDL_Surface *canvas, int x, int y, int max_intensity) { Uint8 r, g, b, intensity; Uint32 pixel; @@ -135,7 +135,7 @@ static void do_spraypaint(magic_api * api, SDL_Surface * canvas, int x, int y, i } static void do_spraypaint_circle(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy, dist; @@ -160,8 +160,8 @@ static void do_spraypaint_circle(void *ptr, int which ATTRIBUTE_UNUSED, spraypaint_cnt++; } -void spraypaint_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void spraypaint_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, (spraypaint_radius / 8) + 1, do_spraypaint_circle); @@ -188,16 +188,16 @@ void spraypaint_drag(magic_api * api, int which, SDL_Surface * canvas, api->playsound(spraypaint_snd_spray, (x * 255) / canvas->w, 255); } -void spraypaint_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void spraypaint_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { spraypaint_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void spraypaint_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void spraypaint_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { api->stopsound(); if (spraypaint_cnt >= 1000) @@ -207,7 +207,7 @@ void spraypaint_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN } } -void spraypaint_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void spraypaint_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (spraypaint_snd_spray != NULL) Mix_FreeChunk(spraypaint_snd_spray); @@ -215,50 +215,50 @@ void spraypaint_shutdown(magic_api * api ATTRIBUTE_UNUSED) Mix_FreeChunk(spraypaint_snd_shake); } -void spraypaint_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void spraypaint_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { spraypaint_r = r; spraypaint_g = g; spraypaint_b = b; } -int spraypaint_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int spraypaint_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void spraypaint_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void spraypaint_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { spraypaint_cnt = 0; } -void spraypaint_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void spraypaint_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int spraypaint_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int spraypaint_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 spraypaint_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 spraypaint_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 12; } -Uint8 spraypaint_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 spraypaint_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void spraypaint_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void spraypaint_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { spraypaint_radius = size * 8; } diff --git a/magic/src/stretch.c b/magic/src/stretch.c index a8e9cd951..cb35b246a 100644 --- a/magic/src/stretch.c +++ b/magic/src/stretch.c @@ -83,14 +83,14 @@ Uint32 stretch_api_version(void) return (TP_MAGIC_API_VERSION); } -void stretch_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void stretch_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -int stretch_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int stretch_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -100,12 +100,12 @@ int stretch_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint return (1); } -int stretch_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int stretch_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return STRETCH_NUMTOOLS; } -SDL_Surface *stretch_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *stretch_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -114,12 +114,12 @@ SDL_Surface *stretch_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *stretch_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *stretch_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext("Stretch")); } -int stretch_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int stretch_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -129,34 +129,34 @@ int stretch_get_order(int which ATTRIBUTE_UNUSED) return 500; } -char *stretch_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *stretch_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext("Click and drag to stretch part of your picture vertically or horizontally.")); } -int stretch_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int stretch_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void stretch_release(magic_api * api ATTRIBUTE_UNUSED, +void stretch_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void stretch_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void stretch_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(stretch_snd); } // Interactivity functions -void stretch_drag(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, - int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void stretch_drag(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, + int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { SDL_Rect src, dest; float xx, yy; @@ -257,8 +257,8 @@ void stretch_drag(magic_api * api, int which ATTRIBUTE_UNUSED, update_rect->h = canvas->h; } -void stretch_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void stretch_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (y < canvas->h / 2) { @@ -285,36 +285,36 @@ void stretch_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, stretch_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void stretch_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void stretch_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void stretch_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void stretch_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int stretch_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int stretch_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 stretch_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 stretch_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 stretch_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 stretch_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void stretch_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void stretch_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/string.c b/magic/src/string.c index 7558a08a2..b6c821988 100644 --- a/magic/src/string.c +++ b/magic/src/string.c @@ -84,7 +84,7 @@ Uint32 string_api_version(void) return (TP_MAGIC_API_VERSION); } -int string_modes(magic_api * api ATTRIBUTE_UNUSED, int which) +int string_modes(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == STRING_TOOL_FULL_BY_OFFSET) return (MODE_PAINT); @@ -92,9 +92,9 @@ int string_modes(magic_api * api ATTRIBUTE_UNUSED, int which) return (MODE_PAINT_WITH_PREVIEW); } -void string_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void string_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { string_r = r; string_g = g; @@ -103,12 +103,12 @@ void string_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS -int string_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int string_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return STRING_NUMTOOLS; } -SDL_Surface *string_get_icon(magic_api * api, int which) +SDL_Surface *string_get_icon(magic_api *api, int which) { char fname[1024]; @@ -129,7 +129,7 @@ SDL_Surface *string_get_icon(magic_api * api, int which) } -char *string_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *string_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { switch (which) { @@ -144,7 +144,7 @@ char *string_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS } } -int string_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int string_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_ARTISTIC; } @@ -165,7 +165,7 @@ int string_get_order(int which) } -char *string_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *string_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { switch (which) { @@ -182,13 +182,13 @@ char *string_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mo } } -int string_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int string_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void string_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void string_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int dx, dy; @@ -207,7 +207,7 @@ void string_release(magic_api * api, int which, } } -int string_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int string_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -223,7 +223,7 @@ int string_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -void string_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void string_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i = 0; @@ -238,9 +238,9 @@ void string_shutdown(magic_api * api ATTRIBUTE_UNUSED) } } -void string_switchin(magic_api * api ATTRIBUTE_UNUSED, +void string_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED) { canvas_backup = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h, @@ -248,9 +248,9 @@ void string_switchin(magic_api * api ATTRIBUTE_UNUSED, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask); } -void string_switchout(magic_api * api ATTRIBUTE_UNUSED, +void string_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * snapshot ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *snapshot ATTRIBUTE_UNUSED) { SDL_FreeSurface(canvas_backup); canvas_backup = NULL; @@ -260,7 +260,7 @@ void string_switchout(magic_api * api ATTRIBUTE_UNUSED, void string_callback(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -268,7 +268,7 @@ void string_callback(void *ptr, int which ATTRIBUTE_UNUSED, } void string_callback_xor(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -276,8 +276,8 @@ void string_callback_xor(void *ptr, int which ATTRIBUTE_UNUSED, } -void string_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void string_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { SDL_BlitSurface(canvas, NULL, canvas_backup, NULL); @@ -289,8 +289,8 @@ void string_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } static void string_draw_full_by_offset(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) + SDL_Surface *canvas, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { magic_api *api = (magic_api *) ptr; int u; @@ -388,9 +388,9 @@ void compute_middle(int start_point, int end_point, int vertex, int *middle) *middle = min(*middle, vertex) + (max(*middle, vertex) - min(*middle, vertex)) / 2; } -void string_draw_triangle_preview(magic_api * api, int which, - SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void string_draw_triangle_preview(magic_api *api, int which, + SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { int middle_x, middle_y; @@ -411,9 +411,9 @@ void string_draw_triangle_preview(magic_api * api, int which, api->line((void *)api, which, canvas, snapshot, string_ox, y, middle_x, middle_y, 1, string_callback_xor); } -void string_draw_angle_preview(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, - int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void string_draw_angle_preview(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, + int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { int middle_x, middle_y; int dx, dy; @@ -444,10 +444,10 @@ void string_draw_angle_preview(magic_api * api, int which, api->line((void *)api, which, canvas, snapshot, x, y, middle_x, middle_y, 1, string_callback_xor); } -void string_draw_angle(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void string_draw_angle(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { float first_arm_step_x, first_arm_step_y, second_arm_step_x, second_arm_step_y; int i; @@ -480,9 +480,9 @@ void string_draw_angle(magic_api * api, int which ATTRIBUTE_UNUSED, } } -void string_draw_triangle(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, - int ox, int oy, int x, int y, SDL_Rect * update_rect) +void string_draw_triangle(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, + int ox, int oy, int x, int y, SDL_Rect *update_rect) { SDL_BlitSurface(canvas_backup, 0, canvas, 0); scale_coords(&ox, &oy, &x, &y); @@ -496,9 +496,9 @@ void string_draw_triangle(magic_api * api, int which ATTRIBUTE_UNUSED, string_draw_angle((void *)api, which, canvas, snapshot, string_ox, string_oy, x, y, update_rect); } -void string_draw_wrapper(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int ox, - int oy, int x, int y, SDL_Rect * update_rect) +void string_draw_wrapper(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int ox, + int oy, int x, int y, SDL_Rect *update_rect) { if (which == STRING_TOOL_FULL_BY_OFFSET) string_draw_full_by_offset((void *)api, which, canvas, snapshot, x, y, update_rect); @@ -526,8 +526,8 @@ void string_set_vertex(int x, int y) string_vertex_done = 1; } -void string_drag(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void string_drag(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { if ((x < canvas->w) && (y < canvas->h) && (ox < canvas->w) && (oy < canvas->h) && ((signed)x > 0) && ((signed)y > 0) && ((signed)ox > 0) && ((signed)oy > 0)) @@ -541,18 +541,18 @@ void string_drag(magic_api * api, int which, -Uint8 string_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 string_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 string_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 string_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void string_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void string_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/swirls.c b/magic/src/swirls.c index 39bc289b9..20c1e95a4 100644 --- a/magic/src/swirls.c +++ b/magic/src/swirls.c @@ -124,7 +124,7 @@ Uint32 swirls_api_version(void) return (TP_MAGIC_API_VERSION); } -int swirls_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int swirls_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -138,13 +138,13 @@ int swirls_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 return (1); } -int swirls_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int swirls_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_SWIRL_TOOLS); } -SDL_Surface *swirls_get_icon(magic_api * api, int which) +SDL_Surface *swirls_get_icon(magic_api *api, int which) { char fname[1024]; @@ -153,12 +153,12 @@ SDL_Surface *swirls_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } -char *swirls_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *swirls_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return strdup(gettext(swirl_names[which])); } -int swirls_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int swirls_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == SWIRL_TOOL_FUR) { @@ -175,12 +175,12 @@ int swirls_get_order(int which) return swirls_orders[which]; } -char *swirls_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *swirls_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return strdup(gettext(swirl_descriptions[which][mode - 1])); } -int swirls_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which) +int swirls_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == SWIRL_TOOL_FUR) { @@ -192,7 +192,7 @@ int swirls_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which) } } -int swirls_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int swirls_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { if (which == SWIRL_TOOL_FUR) { @@ -204,7 +204,7 @@ int swirls_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) } } -void swirls_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void swirls_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -216,8 +216,8 @@ void swirls_shutdown(magic_api * api ATTRIBUTE_UNUSED) } void -swirls_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +swirls_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { if (snd_effects[which] != NULL) api->stopsound(); @@ -256,8 +256,8 @@ swirls_click(magic_api * api, int which, int mode, void -swirls_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +swirls_drag(magic_api *api ATTRIBUTE_UNUSED, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { if (which == SWIRL_TOOL_FUR) { @@ -276,20 +276,20 @@ swirls_drag(magic_api * api ATTRIBUTE_UNUSED, int which, SDL_Surface * canvas, } -void swirls_release(magic_api * api, int which, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void swirls_release(magic_api *api, int which, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { if (snd_effects[which] != NULL && which != SWIRL_TOOL_FUR) api->stopsound(); } -void swirls_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void swirls_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { swirl_fur_color_r = r; swirl_fur_color_g = g; @@ -298,7 +298,7 @@ void swirls_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS void swirls_line_callback_drag(void *ptr, int which, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { int i, ang_deg, radius, nx, ny; double ang_rad; @@ -320,7 +320,7 @@ void swirls_line_callback_drag(void *ptr, int which, } } -void swirls_draw_stroke(magic_api * api, int which, SDL_Surface * canvas, int x, int y) +void swirls_draw_stroke(magic_api *api, int which, SDL_Surface *canvas, int x, int y) { int x1, y1, x2, y2, len; double a; @@ -393,7 +393,7 @@ void swirls_draw_stroke(magic_api * api, int which, SDL_Surface * canvas, int x, void swirls_line_callback_draw_stroke(void *ptr, int which, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -416,8 +416,8 @@ void swirls_line_callback_draw_stroke(void *ptr, int which, } -void swirls_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void swirls_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { if (swirls_snapshot == NULL) swirls_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h, @@ -428,8 +428,8 @@ void swirls_switchin(magic_api * api ATTRIBUTE_UNUSED, SDL_BlitSurface(canvas, NULL, swirls_snapshot, NULL); } -void swirls_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void swirls_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } @@ -439,7 +439,7 @@ double get_angle(int x, int y, int target_x, int target_y) } -Uint8 swirls_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 swirls_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { /* TODO - We could offer different radiuses for "Circles and Rays", * and perhaps some different functionality for "Fur", based on size. @@ -447,13 +447,13 @@ Uint8 swirls_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT return 0; } -Uint8 swirls_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 swirls_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void swirls_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void swirls_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/tessell.c b/magic/src/tessell.c index b73ec6681..5470e2195 100644 --- a/magic/src/tessell.c +++ b/magic/src/tessell.c @@ -35,7 +35,8 @@ #define REPEAT_CNT 3 #define SIN_60DEG 0.866025403784439 -enum { +enum +{ TOOL_TESSELL_POINTY_TOP, TOOL_TESSELL_FLAT_TOP, NUM_TOOLS @@ -55,17 +56,17 @@ int tessell_get_order(int which); char *tessell_get_description(magic_api * api, int which, int mode); void tessell_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); + SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); void tessell_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void tessell_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); + SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect); void tessell_shutdown(magic_api * api); void tessell_set_color(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); + SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect); int tessell_requires_colors(magic_api * api, int which); void tessell_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas); void tessell_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas); @@ -73,7 +74,7 @@ int tessell_modes(magic_api * api, int which); Uint8 tessell_accepted_sizes(magic_api * api, int which, int mode); Uint8 tessell_default_size(magic_api * api, int which, int mode); void tessell_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, - SDL_Rect * update_rect); + SDL_Rect * update_rect); Uint32 tessell_api_version(void) @@ -81,7 +82,7 @@ Uint32 tessell_api_version(void) return (TP_MAGIC_API_VERSION); } -int tessell_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int tessell_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -91,32 +92,32 @@ int tessell_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint return (1); } -int tessell_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int tessell_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (NUM_TOOLS); } -SDL_Surface *tessell_get_icon(magic_api * api, int which) +SDL_Surface *tessell_get_icon(magic_api *api, int which) { char fname[1024]; if (which == TOOL_TESSELL_POINTY_TOP) snprintf(fname, sizeof(fname), "%simages/magic/tessellation-pointy.png", api->data_directory); - else // which == TOOL_TESSELL_FLAT_TOP + else // which == TOOL_TESSELL_FLAT_TOP snprintf(fname, sizeof(fname), "%simages/magic/tessellation-flat.png", api->data_directory); return (IMG_Load(fname)); } -char *tessell_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *tessell_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == TOOL_TESSELL_POINTY_TOP) return (strdup(gettext("Tessellation Pointy"))); - else // which == TOOL_TESSELL_TOP_TOP + else // which == TOOL_TESSELL_TOP_TOP return (strdup(gettext("Tessellation Flat"))); } -int tessell_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tessell_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PATTERN_PAINTING; } @@ -126,16 +127,16 @@ int tessell_get_order(int which) return 300 + which; } -char *tessell_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *tessell_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (which == TOOL_TESSELL_POINTY_TOP) return (strdup(gettext("Click and drag to draw a repeating tessellating pattern of pointy-topped hexagons."))); - else // which == TOOL_TESSELL_FLAT_TOP + else // which == TOOL_TESSELL_FLAT_TOP return (strdup(gettext("Click and drag to draw a repeating tessellating pattern of flat-topped hexagons."))); } static void do_tessell_circle(void *ptr, int which, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { int xx, yy, rx, ry, sx, sy; magic_api *api = (magic_api *) ptr; @@ -157,7 +158,7 @@ static void do_tessell_circle(void *ptr, int which, sx += tessell_width / 2; sy = ry * tessell_height; } - else // which == TOOL_TESSELL_FLAT_TOP + else // which == TOOL_TESSELL_FLAT_TOP { sx = rx * tessell_width; sy = ry * tessell_height; @@ -173,8 +174,8 @@ static void do_tessell_circle(void *ptr, int which, } } -void tessell_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void tessell_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_tessell_circle); @@ -186,39 +187,38 @@ void tessell_drag(magic_api * api, int which, SDL_Surface * canvas, api->playsound(tessell_snd, (x * 255) / canvas->w, 255); } -void tessell_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void tessell_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { tessell_drag(api, which, canvas, last, x, y, x, y, update_rect); } -void tessell_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tessell_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void tessell_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void tessell_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (tessell_snd != NULL) Mix_FreeChunk(tessell_snd); } -void tessell_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tessell_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { tessell_color = SDL_MapRGB(canvas->format, r, g, b); } -int tessell_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tessell_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void tessell_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void tessell_switchin(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { int tessell_mult; @@ -232,37 +232,37 @@ void tessell_switchin(magic_api * api ATTRIBUTE_UNUSED, tessell_width = tessell_mult; tessell_height = tessell_mult * SIN_60DEG; } - else // which == TOOL_TESSELL_FLAT_TOP + else // which == TOOL_TESSELL_FLAT_TOP { tessell_width = tessell_mult * SIN_60DEG; tessell_height = tessell_mult; } } -void tessell_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void tessell_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int tessell_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tessell_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 tessell_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 tessell_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 8; } -Uint8 tessell_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 tessell_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void tessell_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tessell_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { tessell_radius = size; } diff --git a/magic/src/tint.c b/magic/src/tint.c index db6d5945d..98ebbbde4 100644 --- a/magic/src/tint.c +++ b/magic/src/tint.c @@ -123,7 +123,7 @@ Uint32 tint_api_version(void) } //Load sounds -int tint_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int tint_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -136,13 +136,13 @@ int tint_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 c return (1); } -int tint_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int tint_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (tint_NUM_TOOLS); } // Load our icons: -SDL_Surface *tint_get_icon(magic_api * api, int which) +SDL_Surface *tint_get_icon(magic_api *api, int which) { char fname[1024]; @@ -151,13 +151,13 @@ SDL_Surface *tint_get_icon(magic_api * api, int which) } // Return our names, localized: -char *tint_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *tint_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(tint_names[which]))); } // Return our group (both the same): -int tint_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tint_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } @@ -169,7 +169,7 @@ int tint_get_order(int which) } // Return our descriptions, localized: -char *tint_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) +char *tint_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode) { return (strdup(gettext(tint_descs[which][mode - 1]))); } @@ -180,7 +180,7 @@ static int tint_grey(Uint8 r1, Uint8 g1, Uint8 b1) return 0.3 * r1 + .59 * g1 + 0.11 * b1; } -static void do_tint_pixel(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_tint_pixel(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { magic_api *api = (magic_api *) ptr; @@ -215,7 +215,7 @@ static void do_tint_pixel(void *ptr, int which, SDL_Surface * canvas, SDL_Surfac } // Do the effect: -static void do_tint_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which) +static void do_tint_full(void *ptr, SDL_Surface *canvas, SDL_Surface *last, int which) { int x, y; @@ -228,7 +228,7 @@ static void do_tint_full(void *ptr, SDL_Surface * canvas, SDL_Surface * last, in } } -static void do_tint_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y) +static void do_tint_brush(void *ptr, int which, SDL_Surface *canvas, SDL_Surface *last, int x, int y) { int xx, yy; magic_api *api = (magic_api *) ptr; @@ -246,8 +246,8 @@ static void do_tint_brush(void *ptr, int which, SDL_Surface * canvas, SDL_Surfac } // Affect the canvas on drag: -void tint_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void tint_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_tint_brush); @@ -276,8 +276,8 @@ void tint_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void tint_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void tint_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) tint_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -293,16 +293,16 @@ void tint_click(magic_api * api, int which, int mode, } // Affect the canvas on release: -void tint_release(magic_api * api ATTRIBUTE_UNUSED, +void tint_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void tint_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void tint_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -317,9 +317,9 @@ void tint_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void tint_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tint_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { tint_r = r; tint_g = g; @@ -327,12 +327,12 @@ void tint_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED } // Use colors: -int tint_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tint_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void tint_switchin(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas) +void tint_switchin(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas) { int x, y; @@ -359,18 +359,18 @@ void tint_switchin(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBU } } -void tint_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void tint_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int tint_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tint_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN | MODE_PAINT); } -Uint8 tint_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 tint_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { if (mode == MODE_PAINT) return 8; @@ -378,14 +378,14 @@ Uint8 tint_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ return 0; } -Uint8 tint_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 tint_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void tint_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tint_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { tint_RADIUS = size * 4; } diff --git a/magic/src/toothpaste.c b/magic/src/toothpaste.c index 150426f56..6c9842b96 100644 --- a/magic/src/toothpaste.c +++ b/magic/src/toothpaste.c @@ -115,7 +115,7 @@ Uint32 toothpaste_api_version(void) } -int toothpaste_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int toothpaste_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char fname[1024]; @@ -130,7 +130,7 @@ int toothpaste_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, U return (toothpaste_setup_weights(api)); } -int toothpaste_setup_weights(magic_api * api) +int toothpaste_setup_weights(magic_api *api) { int k, j; @@ -165,13 +165,13 @@ int toothpaste_setup_weights(magic_api * api) return (1); } -int toothpaste_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int toothpaste_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (toothpaste_NUM_TOOLS); } // Load our icons: -SDL_Surface *toothpaste_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *toothpaste_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -180,13 +180,13 @@ SDL_Surface *toothpaste_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *toothpaste_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *toothpaste_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(toothpaste_names[which]))); } // Return our groups: -int toothpaste_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) +int toothpaste_get_group(magic_api *api ATTRIBUTE_UNUSED, int which) { return toothpaste_groups[which]; } @@ -198,14 +198,14 @@ int toothpaste_get_order(int which) } // Return our descriptions, localized: -char *toothpaste_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *toothpaste_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext(toothpaste_descs[which]))); } // Do the effect: static void do_toothpaste(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -238,8 +238,8 @@ static void do_toothpaste(void *ptr, int which ATTRIBUTE_UNUSED, } // Affect the canvas on drag: -void toothpaste_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void toothpaste_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_toothpaste); @@ -254,24 +254,24 @@ void toothpaste_drag(magic_api * api, int which, SDL_Surface * canvas, } // Affect the canvas on click: -void toothpaste_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void toothpaste_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { toothpaste_drag(api, which, canvas, last, x, y, x, y, update_rect); } // Affect the canvas on release: -void toothpaste_release(magic_api * api ATTRIBUTE_UNUSED, +void toothpaste_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void toothpaste_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void toothpaste_shutdown(magic_api *api ATTRIBUTE_UNUSED) { //Clean up sounds int i; @@ -291,9 +291,9 @@ void toothpaste_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void toothpaste_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, - Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void toothpaste_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, + Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { toothpaste_r = r; toothpaste_g = g; @@ -301,41 +301,41 @@ void toothpaste_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ } // Use colors: -int toothpaste_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int toothpaste_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -void toothpaste_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void toothpaste_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void toothpaste_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void toothpaste_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int toothpaste_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int toothpaste_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 toothpaste_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 toothpaste_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 6; } -Uint8 toothpaste_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 toothpaste_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 2; } -void toothpaste_set_size(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void toothpaste_set_size(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { toothpaste_RADIUS = size * 5; toothpaste_setup_weights(api); diff --git a/magic/src/tornado.c b/magic/src/tornado.c index 94988d85d..41d212b1c 100644 --- a/magic/src/tornado.c +++ b/magic/src/tornado.c @@ -109,7 +109,7 @@ Uint32 tornado_api_version(void) // No setup required: -int tornado_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int tornado_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -132,13 +132,13 @@ int tornado_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint } // We have multiple tools: -int tornado_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int tornado_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } // Load our icons: -SDL_Surface *tornado_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *tornado_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -148,13 +148,13 @@ SDL_Surface *tornado_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) } // Return our names, localized: -char *tornado_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *tornado_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Tornado"))); } // Return our groups: -int tornado_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tornado_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_ARTISTIC; } @@ -166,15 +166,15 @@ int tornado_get_order(int which ATTRIBUTE_UNUSED) } // Return our descriptions, localized: -char *tornado_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +char *tornado_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext("Click and drag to draw a tornado funnel on your picture."))); } // Affect the canvas on drag: -static void tornado_predrag(magic_api * api ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y) +static void tornado_predrag(magic_api *api ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y) { if (x < tornado_min_x) tornado_min_x = x; @@ -207,8 +207,8 @@ static void tornado_predrag(magic_api * api ATTRIBUTE_UNUSED, } } -void tornado_drag(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void tornado_drag(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int ox, int oy, int x, int y, SDL_Rect *update_rect) { tornado_predrag(api, canvas, last, ox, oy, x, y); @@ -232,8 +232,8 @@ void tornado_drag(magic_api * api, int which ATTRIBUTE_UNUSED, } // Affect the canvas on click: -void tornado_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void tornado_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { tornado_min_x = x; tornado_max_x = x; @@ -251,8 +251,8 @@ void tornado_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, } // Affect the canvas on release: -void tornado_release(magic_api * api, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void tornado_release(magic_api *api, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { /* Don't let tornado be too low compared to base: */ @@ -288,7 +288,7 @@ void tornado_release(magic_api * api, int which ATTRIBUTE_UNUSED, } -static void tornado_drawtornado(magic_api * api, SDL_Surface * canvas, int x, int y) +static void tornado_drawtornado(magic_api *api, SDL_Surface *canvas, int x, int y) { SDL_Surface *aux_surf; SDL_Rect dest; @@ -301,7 +301,7 @@ static void tornado_drawtornado(magic_api * api, SDL_Surface * canvas, int x, in SDL_FreeSurface(aux_surf); } -static void tornado_drawbase(magic_api * api ATTRIBUTE_UNUSED, SDL_Surface * canvas) +static void tornado_drawbase(magic_api *api ATTRIBUTE_UNUSED, SDL_Surface *canvas) { SDL_Rect dest; @@ -311,7 +311,7 @@ static void tornado_drawbase(magic_api * api ATTRIBUTE_UNUSED, SDL_Surface * can SDL_BlitSurface(tornado_base, NULL, canvas, &dest); } -static Uint32 tornado_mess(Uint32 pixel, SDL_Surface * canvas) +static Uint32 tornado_mess(Uint32 pixel, SDL_Surface *canvas) { Uint8 r, g, b, a; float f = (float)rand() * 255 / RAND_MAX; @@ -322,8 +322,8 @@ static Uint32 tornado_mess(Uint32 pixel, SDL_Surface * canvas) (tornado_g + g + (Uint8) f * 2) / 4, (tornado_b + b + (Uint8) f * 2) / 4, a)); } -static void tornado_drawstalk(magic_api * api, SDL_Surface * canvas, - SDL_Surface * last, int top_x, int top_y, +static void tornado_drawstalk(magic_api *api, SDL_Surface *canvas, + SDL_Surface *last, int top_x, int top_y, int minx, int maxx, int bottom_x, int bottom_y, int final) { Point2D control_points[4]; @@ -429,7 +429,7 @@ static void tornado_drawstalk(magic_api * api, SDL_Surface * canvas, free(curve); } -void tornado_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void tornado_shutdown(magic_api *api ATTRIBUTE_UNUSED) { /* if (tornado_click_snd != NULL) @@ -448,9 +448,9 @@ void tornado_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void tornado_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tornado_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { tornado_r = r; tornado_g = g; @@ -460,7 +460,7 @@ void tornado_set_color(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface } // Use colors: -int tornado_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tornado_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } @@ -480,7 +480,7 @@ cp[3] is the end point, or P3 in the above diagram t is the parameter value, 0 <= t <= 1 */ -static Point2D tornado_PointOnCubicBezier(Point2D * cp, float t) +static Point2D tornado_PointOnCubicBezier(Point2D *cp, float t) { float ax, bx, cx; float ay, by, cy; @@ -515,7 +515,7 @@ static Point2D tornado_PointOnCubicBezier(Point2D * cp, float t) */ -static void tornado_ComputeBezier(Point2D * cp, int numberOfPoints, Point2D * curve) +static void tornado_ComputeBezier(Point2D *cp, int numberOfPoints, Point2D *curve) { float dt; int i; @@ -527,7 +527,7 @@ static void tornado_ComputeBezier(Point2D * cp, int numberOfPoints, Point2D * cu } -static void tornado_colorize_cloud(magic_api * api) +static void tornado_colorize_cloud(magic_api *api) { Uint32 amask; int x, y; @@ -569,35 +569,35 @@ static void tornado_colorize_cloud(magic_api * api) SDL_UnlockSurface(tornado_cloud); } -void tornado_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void tornado_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void tornado_switchout(magic_api * api, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void tornado_switchout(magic_api *api, int which ATTRIBUTE_UNUSED, + int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { api->stopsound(); } -int tornado_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tornado_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT_WITH_PREVIEW); } -Uint8 tornado_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 tornado_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 tornado_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 tornado_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void tornado_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tornado_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/trochoids.c b/magic/src/trochoids.c index bc426609f..78a2d00ee 100644 --- a/magic/src/trochoids.c +++ b/magic/src/trochoids.c @@ -203,7 +203,7 @@ Uint32 trochoids_api_version(void) } -int trochoids_init(magic_api * api, Uint8 disabled_features, Uint8 complexity_level ATTRIBUTE_UNUSED) +int trochoids_init(magic_api *api, Uint8 disabled_features, Uint8 complexity_level ATTRIBUTE_UNUSED) { int i; char filename[1024]; @@ -234,13 +234,13 @@ int trochoids_init(magic_api * api, Uint8 disabled_features, Uint8 complexity_le } -int trochoids_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int trochoids_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (num_tools[tp_offers_sizes]); } -SDL_Surface *trochoids_get_icon(magic_api * api, int which) +SDL_Surface *trochoids_get_icon(magic_api *api, int which) { char filename[1024]; @@ -250,13 +250,13 @@ SDL_Surface *trochoids_get_icon(magic_api * api, int which) } -char *trochoids_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *trochoids_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { return (strdup(gettext(tool_names[which_to_tool[which]]))); } -int trochoids_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int trochoids_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MAGIC_TYPE_ARTISTIC); } @@ -268,36 +268,36 @@ int trochoids_get_order(int which) } -char *trochoids_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *trochoids_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return (strdup(gettext(tool_descriptions[which_to_tool[which]]))); } -int trochoids_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int trochoids_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 1; } -int trochoids_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int trochoids_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MODE_PAINT; } -Uint8 trochoids_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 trochoids_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return NUM_SIZES; } -Uint8 trochoids_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 trochoids_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return DEFAULT_SIZE; } -void trochoids_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void trochoids_shutdown(magic_api *api ATTRIBUTE_UNUSED) { int i; @@ -311,8 +311,8 @@ void trochoids_shutdown(magic_api * api ATTRIBUTE_UNUSED) } -void trochoids_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void trochoids_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { trochoids_x = x; trochoids_y = y; @@ -322,17 +322,17 @@ void trochoids_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, /* Affect the canvas on drag: */ -void trochoids_drag(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, - int old_x ATTRIBUTE_UNUSED, int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void trochoids_drag(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, + int old_x ATTRIBUTE_UNUSED, int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { dragged = 1; trochoids_work(api, which, canvas, snapshot, x, y, update_rect, 1); trochoids_sound(api, SND_DRAG, x, y); } -void trochoids_work(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect, int guides) +void trochoids_work(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect, int guides) { int R, r, d, LCM; int px, py, px2, py2; @@ -520,8 +520,8 @@ void trochoids_work(magic_api * api, int which, } -void trochoids_release(magic_api * api, int which, - SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect) +void trochoids_release(magic_api *api, int which, + SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect) { int tool, snd_idx; @@ -572,7 +572,7 @@ void trochoids_release(magic_api * api, int which, /* Play a sound; volume and panning will be based on the size and position of the shape being generated by the user's UI interaction */ -void trochoids_sound(magic_api * api, int snd_idx, int x, int y) +void trochoids_sound(magic_api *api, int snd_idx, int x, int y) { int R, vol, pan; @@ -599,25 +599,25 @@ void trochoids_sound(magic_api * api, int snd_idx, int x, int y) } -void trochoids_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void trochoids_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { trochoids_color = SDL_MapRGB(canvas->format, r, g, b); } -void trochoids_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void trochoids_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { trochoids_size = (size - 1); /* array index is 0-based, but Tux Paint returns between 1...{accepted sizes} */ } void trochoids_line_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) pointer; @@ -625,7 +625,7 @@ void trochoids_line_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_ } void trochoids_xorline_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) pointer; @@ -635,13 +635,13 @@ void trochoids_xorline_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBU api->xorpixel(canvas, x + 1, y + 1); } -void trochoids_switchin(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED) +void trochoids_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void trochoids_switchout(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED) +void trochoids_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED) { } diff --git a/magic/src/tv.c b/magic/src/tv.c index a61f09462..ed209c1ad 100644 --- a/magic/src/tv.c +++ b/magic/src/tv.c @@ -86,14 +86,14 @@ Uint32 tv_api_version(void) return (TP_MAGIC_API_VERSION); } -void tv_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, - Uint8 b ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tv_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, + Uint8 b ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { //get the colors from API and store it in structure } -int tv_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int tv_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -103,12 +103,12 @@ int tv_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 com return (1); } -int tv_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int tv_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return NUM_TV_TOOLS; } -SDL_Surface *tv_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *tv_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -117,7 +117,7 @@ SDL_Surface *tv_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *tv_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *tv_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (which == TV_TOOL_TV_CLASSIC) return strdup(gettext("TV")); @@ -125,7 +125,7 @@ char *tv_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) return strdup(gettext("TV (Bright)")); } -int tv_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tv_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_DISTORTS; } @@ -135,7 +135,7 @@ int tv_get_order(int which) return tv_orders[which]; } -char *tv_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *tv_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return strdup(gettext("Click and drag to make parts of your picture look like they are on television.")); @@ -143,19 +143,19 @@ char *tv_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U return strdup(gettext("Click to make your picture look like it's on television.")); } -int tv_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tv_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void tv_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * snapshot ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tv_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *snapshot ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void tv_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void tv_shutdown(magic_api *api ATTRIBUTE_UNUSED) { Mix_FreeChunk(tv_snd); } @@ -163,7 +163,7 @@ void tv_shutdown(magic_api * api ATTRIBUTE_UNUSED) // Interactivity functions void tv_do_tv(void *ptr_to_api, int which_tool, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr_to_api; int r, g, b, i; @@ -223,7 +223,7 @@ void tv_do_tv(void *ptr_to_api, int which_tool, } void tv_paint_tv(void *ptr_to_api, int which_tool, - SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y) { int i, j; magic_api *api = (magic_api *) ptr_to_api; @@ -242,8 +242,8 @@ void tv_paint_tv(void *ptr_to_api, int which_tool, } } -void tv_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void tv_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line(api, which, canvas, snapshot, ox, oy, x, y, 1, tv_paint_tv); @@ -254,8 +254,8 @@ void tv_drag(magic_api * api, int which, SDL_Surface * canvas, api->playsound(tv_snd, (x * 255) / canvas->w, 255); } -void tv_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void tv_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_FULLSCREEN) { @@ -278,25 +278,25 @@ void tv_click(magic_api * api, int which, int mode, } } -void tv_switchin(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void tv_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void tv_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void tv_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int tv_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int tv_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_FULLSCREEN | MODE_PAINT); } -Uint8 tv_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 tv_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -304,14 +304,14 @@ Uint8 tv_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN return 0; } -Uint8 tv_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 tv_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void tv_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 size, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void tv_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { tv_radius = size * 4; } diff --git a/magic/src/waves.c b/magic/src/waves.c index a274d1c9b..a38c46a98 100644 --- a/magic/src/waves.c +++ b/magic/src/waves.c @@ -73,7 +73,7 @@ Uint32 waves_api_version(void) // No setup required: -int waves_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int waves_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -88,13 +88,13 @@ int waves_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 } // We have multiple tools: -int waves_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int waves_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return 2; } // Load our icons: -SDL_Surface *waves_get_icon(magic_api * api, int which) +SDL_Surface *waves_get_icon(magic_api *api, int which) { char fname[1024]; @@ -107,7 +107,7 @@ SDL_Surface *waves_get_icon(magic_api * api, int which) } // Return our group (both the same): -int waves_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int waves_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_PICTURE_WARPS; } @@ -119,7 +119,7 @@ int waves_get_order(int which) } // Return our names, localized: -char *waves_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) +char *waves_get_name(magic_api *api ATTRIBUTE_UNUSED, int which) { if (!which) return (strdup(gettext("Waves"))); @@ -128,7 +128,7 @@ char *waves_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) } // Return our descriptions, localized: -char *waves_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) +char *waves_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { if (!which) return (strdup @@ -140,9 +140,9 @@ char *waves_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mod } -void waves_drag(magic_api * api ATTRIBUTE_UNUSED, int which, - SDL_Surface * canvas, SDL_Surface * last, - int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void waves_drag(magic_api *api ATTRIBUTE_UNUSED, int which, + SDL_Surface *canvas, SDL_Surface *last, + int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { int xx, yy; SDL_Rect src, dest; @@ -199,24 +199,24 @@ void waves_drag(magic_api * api ATTRIBUTE_UNUSED, int which, } // Affect the canvas on click: -void waves_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect) +void waves_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas, SDL_Surface *last, int x, int y, SDL_Rect *update_rect) { waves_drag(api, which, canvas, last, x, y, x, y, update_rect); api->playsound(waves_snd[which], 128, 255); } // Affect the canvas on release: -void waves_release(magic_api * api ATTRIBUTE_UNUSED, +void waves_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, - int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, + int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // No setup happened: -void waves_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void waves_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (waves_snd[0] != NULL) Mix_FreeChunk(waves_snd[0]); @@ -225,47 +225,47 @@ void waves_shutdown(magic_api * api ATTRIBUTE_UNUSED) } // Record the color from Tux Paint: -void waves_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, +void waves_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED, - SDL_Rect * update_rect ATTRIBUTE_UNUSED) + SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } // Use colors: -int waves_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int waves_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void waves_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void waves_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void waves_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void waves_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int waves_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int waves_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT); } -Uint8 waves_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 waves_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -Uint8 waves_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 waves_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 0; } -void waves_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void waves_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } diff --git a/magic/src/xor.c b/magic/src/xor.c index f28348dad..86d3707a9 100644 --- a/magic/src/xor.c +++ b/magic/src/xor.c @@ -71,7 +71,7 @@ Uint32 xor_api_version(void) return (TP_MAGIC_API_VERSION); } -int xor_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) +int xor_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED) { char fname[1024]; @@ -81,12 +81,12 @@ int xor_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 co return (1); } -int xor_get_tool_count(magic_api * api ATTRIBUTE_UNUSED) +int xor_get_tool_count(magic_api *api ATTRIBUTE_UNUSED) { return (1); } -SDL_Surface *xor_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) +SDL_Surface *xor_get_icon(magic_api *api, int which ATTRIBUTE_UNUSED) { char fname[1024]; @@ -95,12 +95,12 @@ SDL_Surface *xor_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED) return (IMG_Load(fname)); } -char *xor_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +char *xor_get_name(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (strdup(gettext("Xor Colors"))); } -int xor_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int xor_get_group(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } @@ -110,7 +110,7 @@ int xor_get_order(int which ATTRIBUTE_UNUSED) return 800; } -char *xor_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +char *xor_get_description(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return (strdup(gettext("Click and drag to draw an \"Exclusive Or\" (XOR) effect"))); @@ -119,7 +119,7 @@ char *xor_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ } static void do_xor(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; Uint8 r, g, b, xor; @@ -138,7 +138,7 @@ static void do_xor(void *ptr, int which ATTRIBUTE_UNUSED, } static void do_xor_circle(void *ptr, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y) + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y) { magic_api *api = (magic_api *) ptr; int xx, yy; @@ -156,8 +156,8 @@ static void do_xor_circle(void *ptr, int which ATTRIBUTE_UNUSED, } } -void xor_drag(magic_api * api, int which, SDL_Surface * canvas, - SDL_Surface * last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect * update_rect) +void xor_drag(magic_api *api, int which, SDL_Surface *canvas, + SDL_Surface *last ATTRIBUTE_UNUSED, int ox, int oy, int x, int y, SDL_Rect *update_rect) { api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_xor_circle); @@ -184,8 +184,8 @@ void xor_drag(magic_api * api, int which, SDL_Surface * canvas, api->playsound(xor_snd, (x * 255) / canvas->w, 255); } -void xor_click(magic_api * api, int which, int mode, - SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect * update_rect) +void xor_click(magic_api *api, int which, int mode, + SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect) { if (mode == MODE_PAINT) xor_drag(api, which, canvas, last, x, y, x, y, update_rect); @@ -205,47 +205,47 @@ void xor_click(magic_api * api, int which, int mode, } } -void xor_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, - int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void xor_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, int x ATTRIBUTE_UNUSED, + int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -void xor_shutdown(magic_api * api ATTRIBUTE_UNUSED) +void xor_shutdown(magic_api *api ATTRIBUTE_UNUSED) { if (xor_snd != NULL) Mix_FreeChunk(xor_snd); } -void xor_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED, - SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, - Uint8 b ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void xor_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED, + SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, + Uint8 b ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { } -int xor_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int xor_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; } -void xor_switchin(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void xor_switchin(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -void xor_switchout(magic_api * api ATTRIBUTE_UNUSED, - int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED) +void xor_switchout(magic_api *api ATTRIBUTE_UNUSED, + int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED) { } -int xor_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +int xor_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return (MODE_PAINT | MODE_FULLSCREEN); } -Uint8 xor_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) +Uint8 xor_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) return 8; @@ -253,14 +253,14 @@ Uint8 xor_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U return 0; } -Uint8 xor_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) +Uint8 xor_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return 4; } -void xor_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, - SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED, - Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED) +void xor_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, + SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, + Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED) { xor_radius = size * 4; } diff --git a/src/android_assets.c b/src/android_assets.c index 0499d20c4..45f865d6d 100644 --- a/src/android_assets.c +++ b/src/android_assets.c @@ -32,7 +32,7 @@ char *get_nativelibdir() return nativelibdir; } -void load_assets_dir(char *dirname, tp_ftw_str ** ffilenames, unsigned *num_file_names) +void load_assets_dir(char *dirname, tp_ftw_str **ffilenames, unsigned *num_file_names) { AAssetDir *assetDir = AAssetManager_openDir(asset_manager, dirname); const char *filename = (const char *)NULL; @@ -67,7 +67,7 @@ void load_assets_dir(char *dirname, tp_ftw_str ** ffilenames, unsigned *num_file *ffilenames = filenames; } -JNIEXPORT jboolean Java_org_tuxpaint_tuxpaintActivity_managertojni(JNIEnv * env, jclass clazz, jobject mgr) +JNIEXPORT jboolean Java_org_tuxpaint_tuxpaintActivity_managertojni(JNIEnv *env, jclass clazz, jobject mgr) { asset_manager = AAssetManager_fromJava(env, mgr); @@ -77,7 +77,7 @@ JNIEXPORT jboolean Java_org_tuxpaint_tuxpaintActivity_managertojni(JNIEnv * env, return 1; } -JNIEXPORT void Java_org_tuxpaint_tuxpaintActivity_setnativelibdir(JNIEnv * env, jclass clazz, jstring path) +JNIEXPORT void Java_org_tuxpaint_tuxpaintActivity_setnativelibdir(JNIEnv *env, jclass clazz, jstring path) { const char *cpath = (*env)->GetStringUTFChars(env, path, NULL); @@ -86,13 +86,13 @@ JNIEXPORT void Java_org_tuxpaint_tuxpaintActivity_setnativelibdir(JNIEnv * env, } -void load_brushes_from_assets(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, const char *dirname, - void (*fn)(SDL_Surface * screen, - SDL_Texture * texture, - SDL_Renderer * renderer, +void load_brushes_from_assets(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, const char *dirname, + void (*fn)(SDL_Surface *screen, + SDL_Texture *texture, + SDL_Renderer *renderer, const char *restrict const dir, - unsigned dirlen, tp_ftw_str * files, + unsigned dirlen, tp_ftw_str *files, unsigned count, const char *restrict const locale)) { unsigned num_file_names = 0; @@ -111,13 +111,12 @@ void load_brushes_from_assets(SDL_Surface * screen, SDL_Texture * texture, -void load_from_assets(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, const char *dirname, - void (*fn)(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, +void load_from_assets(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, const char *dirname, + void (*fn)(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, const char *restrict const dir, - unsigned dirlen, tp_ftw_str * files, - unsigned count, const char *restrict const locale)) + unsigned dirlen, tp_ftw_str *files, unsigned count, const char *restrict const locale)) { unsigned num_file_names = 0; diff --git a/src/android_print.c b/src/android_print.c index 476cc4c28..413840e8a 100644 --- a/src/android_print.c +++ b/src/android_print.c @@ -49,7 +49,7 @@ int IsPrinterAvailable(void) // This function is based on // (1) convert surface to Java BitMap object // (2) call Java PrintHelper to do print job. -const char *SurfacePrint(SDL_Surface * surface) +const char *SurfacePrint(SDL_Surface *surface) { JNIEnv *mEnv = Android_JNI_GetEnv(); jclass mBitmapClass = (*mEnv)->FindClass(mEnv, "android/graphics/Bitmap"); diff --git a/src/cursor.c b/src/cursor.c index 82aaeaf2e..bd4ced7fb 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -54,7 +54,7 @@ int no_fancy_cursors; * * @param c The cursor shape to use. */ -void do_setcursor(SDL_Cursor * c) +void do_setcursor(SDL_Cursor *c) { /* Shut GCC up over the fact that the XBMs are #included within cursor.h but used in tuxpaint.c (and not cursor.c) */ @@ -93,7 +93,7 @@ void do_setcursor(SDL_Cursor * c) * * @param cursor Pointer to a cursor to free; will be set to point to NULL afterwards. */ -void free_cursor(SDL_Cursor ** cursor) +void free_cursor(SDL_Cursor **cursor) { if (*cursor) { diff --git a/src/dirwalk.c b/src/dirwalk.c index 08d083287..d5f5363fc 100644 --- a/src/dirwalk.c +++ b/src/dirwalk.c @@ -79,10 +79,10 @@ extern char *strcasestr(const char *haystack, const char *needle); * @param screen Screen surface, for animating progress bar. * FIXME */ -void loadfont_callback(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, +void loadfont_callback(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, const char *restrict const dir, unsigned dirlen, - tp_ftw_str * files, unsigned i, const char *restrict const locale) + tp_ftw_str *files, unsigned i, const char *restrict const locale) { dirlen = dirlen; @@ -319,14 +319,14 @@ int compare_ftw_str(const void *v1, const void *v2) * @param fn Callback function to invoke * @param locale Locale, to pass to callback function when applicable (i.e., for fonts), else NULL */ -void tp_ftw(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, char *restrict const dir, - unsigned dirlen, int rsrc, void (*fn)(SDL_Surface * screen, - SDL_Texture * texture, - SDL_Renderer * renderer, +void tp_ftw(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, char *restrict const dir, + unsigned dirlen, int rsrc, void (*fn)(SDL_Surface *screen, + SDL_Texture *texture, + SDL_Renderer *renderer, const char *restrict const dir, unsigned dirlen, - tp_ftw_str * files, + tp_ftw_str *files, unsigned count, const char *restrict const locale), const char *restrict const locale) { diff --git a/src/fill.c b/src/fill.c index 91fb2716b..4e21f2410 100644 --- a/src/fill.c +++ b/src/fill.c @@ -203,7 +203,7 @@ void cleanup_queue(void) /* Returns how similar colors 'c1' and 'c2' are */ -double colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2) +double colors_close(SDL_Surface *canvas, Uint32 c1, Uint32 c2) { Uint8 r1, g1, b1, r2, g2, b2; @@ -236,7 +236,7 @@ double colors_close(SDL_Surface * canvas, Uint32 c1, Uint32 c2) } } -int would_flood_fill(SDL_Surface * canvas, Uint32 cur_colr, Uint32 old_colr) +int would_flood_fill(SDL_Surface *canvas, Uint32 cur_colr, Uint32 old_colr) { if (colors_close(canvas, cur_colr, old_colr) < COLOR_MATCH_NARROW) { @@ -248,16 +248,16 @@ int would_flood_fill(SDL_Surface * canvas, Uint32 cur_colr, Uint32 old_colr) } } -void do_flood_fill(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, SDL_Surface * last, - SDL_Surface * canvas, int x, int y, Uint32 cur_colr, - Uint32 old_colr, int *x1, int *y1, int *x2, int *y2, Uint8 * touched) +void do_flood_fill(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, SDL_Surface *last, + SDL_Surface *canvas, int x, int y, Uint32 cur_colr, + Uint32 old_colr, int *x1, int *y1, int *x2, int *y2, Uint8 *touched) { simulate_flood_fill(screen, texture, renderer, last, canvas, x, y, cur_colr, old_colr, x1, y1, x2, y2, touched); } -Uint32 blend(SDL_Surface * canvas, Uint32 draw_colr, Uint32 old_colr, double pct) +Uint32 blend(SDL_Surface *canvas, Uint32 draw_colr, Uint32 old_colr, double pct) { Uint8 old_r, old_g, old_b, draw_r, draw_g, draw_b, new_r, new_g, new_b; @@ -272,11 +272,11 @@ Uint32 blend(SDL_Surface * canvas, Uint32 draw_colr, Uint32 old_colr, double pct return SDL_MapRGB(canvas->format, new_r, new_g, new_b); } -void simulate_flood_fill(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, SDL_Surface * last, - SDL_Surface * canvas, int x, int y, Uint32 cur_colr, +void simulate_flood_fill(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, SDL_Surface *last, + SDL_Surface *canvas, int x, int y, Uint32 cur_colr, Uint32 old_colr, int *extent_x1, int *extent_y1, - int *extent_x2, int *extent_y2, Uint8 * touched) + int *extent_x2, int *extent_y2, Uint8 *touched) { int y_outside; @@ -310,8 +310,8 @@ void simulate_flood_fill(SDL_Surface * screen, SDL_Texture * texture, *extent_y2 = global_extent_y2; } -void simulate_flood_fill_outside_check(SDL_Surface * screen, - SDL_Texture * texture, SDL_Renderer * renderer, int x, int y, int y_outside) +void simulate_flood_fill_outside_check(SDL_Surface *screen, + SDL_Texture *texture, SDL_Renderer *renderer, int x, int y, int y_outside) { int fillL, fillR, narrowFillL, narrowFillR, i, outside, just_queued; double in_line, closeness; @@ -553,9 +553,9 @@ void simulate_flood_fill_outside_check(SDL_Surface * screen, } -void draw_linear_gradient(SDL_Surface * canvas, SDL_Surface * last, +void draw_linear_gradient(SDL_Surface *canvas, SDL_Surface *last, int x_left, int y_top, int x_right, int y_bottom, - int x1, int y1, int x2, int y2, Uint32 draw_color, Uint8 * touched) + int x1, int y1, int x2, int y2, Uint32 draw_color, Uint8 *touched) { Uint32 old_colr, new_colr; int xx, yy; @@ -618,7 +618,7 @@ void draw_linear_gradient(SDL_Surface * canvas, SDL_Surface * last, } } -void draw_brush_fill_single(SDL_Surface * canvas, int x, int y, Uint32 draw_color, Uint8 * touched) +void draw_brush_fill_single(SDL_Surface *canvas, int x, int y, Uint32 draw_color, Uint8 *touched) { int xx, yy; int pix; @@ -640,11 +640,11 @@ void draw_brush_fill_single(SDL_Surface * canvas, int x, int y, Uint32 draw_colo } } -void draw_brush_fill(SDL_Surface * canvas, +void draw_brush_fill(SDL_Surface *canvas, int x_left ATTRIBUTE_UNUSED, int y_top ATTRIBUTE_UNUSED, int x_right ATTRIBUTE_UNUSED, int y_bottom ATTRIBUTE_UNUSED, int x1, int y1, int x2, - int y2, Uint32 draw_color, Uint8 * touched, int *up_x1, int *up_y1, int *up_x2, int *up_y2) + int y2, Uint32 draw_color, Uint8 *touched, int *up_x1, int *up_y1, int *up_x2, int *up_y2) { int dx, dy; int y; @@ -722,8 +722,8 @@ void draw_brush_fill(SDL_Surface * canvas, *up_y2 = orig_y2 + 16; } -void draw_radial_gradient(SDL_Surface * canvas, int x_left, int y_top, - int x_right, int y_bottom, int x, int y, Uint32 draw_color, Uint8 * touched) +void draw_radial_gradient(SDL_Surface *canvas, int x_left, int y_top, + int x_right, int y_bottom, int x, int y, Uint32 draw_color, Uint8 *touched) { Uint32 old_colr, new_colr; int xx, yy; @@ -788,7 +788,7 @@ void draw_radial_gradient(SDL_Surface * canvas, int x_left, int y_top, Converted to C for Tux Paint by Bill Kendrick , 2023 */ -void sdf_pt_get(sdf_grid * g, int x, int y, sdf_point * p) +void sdf_pt_get(sdf_grid *g, int x, int y, sdf_point *p) { if (x >= 0 && x < g->w && y >= 0 && y < g->h) { @@ -800,7 +800,7 @@ void sdf_pt_get(sdf_grid * g, int x, int y, sdf_point * p) } } -void sdf_pt_put(sdf_grid * g, int x, int y, sdf_point p) +void sdf_pt_put(sdf_grid *g, int x, int y, sdf_point p) { memcpy(&(g->grid[y][x]), &p, sizeof(sdf_point)); } @@ -810,7 +810,7 @@ int sdf_distsq(sdf_point p) return ((p.dx * p.dx) + (p.dy * p.dy)); } -void sdf_compare(sdf_grid * g, sdf_point * p, int x, int y, int offsetx, int offsety) +void sdf_compare(sdf_grid *g, sdf_point *p, int x, int y, int offsetx, int offsety) { sdf_point other; @@ -825,7 +825,7 @@ void sdf_compare(sdf_grid * g, sdf_point * p, int x, int y, int offsetx, int off } } -int malloc_sdf_grid(sdf_grid * g, int w, int h) +int malloc_sdf_grid(sdf_grid *g, int w, int h) { int i, abort; @@ -864,7 +864,7 @@ int malloc_sdf_grid(sdf_grid * g, int w, int h) return 1; } -void free_sdf_grid(sdf_grid * g) +void free_sdf_grid(sdf_grid *g) { int i; @@ -879,7 +879,7 @@ void free_sdf_grid(sdf_grid * g) } -void sdf_fill_bitmask_to_sdf_grids(Uint8 * bitmask, int w, int h, sdf_grid * g1, sdf_grid * g2) +void sdf_fill_bitmask_to_sdf_grids(Uint8 *bitmask, int w, int h, sdf_grid *g1, sdf_grid *g2) { int x, y; @@ -902,7 +902,7 @@ void sdf_fill_bitmask_to_sdf_grids(Uint8 * bitmask, int w, int h, sdf_grid * g1, } -void sdf_generate(sdf_grid * g) +void sdf_generate(sdf_grid *g) { int x, y; sdf_point p; @@ -953,7 +953,7 @@ void sdf_generate(sdf_grid * g) /* End of Signed Distance Field functions ------------------------------- */ -void draw_shaped_gradient(SDL_Surface * canvas, Uint32 draw_color, Uint8 * touched) +void draw_shaped_gradient(SDL_Surface *canvas, Uint32 draw_color, Uint8 *touched) { Uint32 old_colr, new_colr; int xx, yy; diff --git a/src/fill_tools.h b/src/fill_tools.h index 8f89bbf98..805760755 100644 --- a/src/fill_tools.h +++ b/src/fill_tools.h @@ -50,12 +50,12 @@ enum }; static int fill_color[NUM_FILLS] = { - 1, /* Flood */ - 1, /* Brush */ - 1, /* Linear gradient */ - 1, /* Radial gradient */ - 1, /* Shaped gradient */ - 0, /* Eraser */ + 1, /* Flood */ + 1, /* Brush */ + 1, /* Linear gradient */ + 1, /* Radial gradient */ + 1, /* Shaped gradient */ + 0, /* Eraser */ }; const char *const fill_tips[NUM_FILLS] = { diff --git a/src/fonts.c b/src/fonts.c index ccc5f03a2..f4f7199a7 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -203,7 +203,7 @@ default_locale_font_t default_local_fonts[] = { {-1, NULL, NULL}, }; -void TuxPaint_Font_CloseFont(TuxPaint_Font * tpf) +void TuxPaint_Font_CloseFont(TuxPaint_Font *tpf) { #ifdef DEBUG printf("%s:%d - TuxPaint_Font_CloseFont step 1 (%p)\n", __FILE__, __LINE__, tpf); @@ -469,7 +469,7 @@ static void reliable_read(int fd, void *buf, size_t count) #endif -static void groupfonts_range(style_info ** base, int count) +static void groupfonts_range(style_info **base, int count) { int boldcounts[4] = { 0, 0, 0, 0 }; int boldmap[4] = { -1, -1, -1, -1 }; @@ -695,7 +695,7 @@ static int compar_fontscore(const void *v1, const void *v2) // // Cooper: Light, Medium, Light Bold, Black // HoeflerText: (nil), Black -static void parse_font_style(style_info * si) +static void parse_font_style(style_info *si) { int have_light = 0; int have_demi = 0; @@ -842,7 +842,7 @@ static void parse_font_style(style_info * si) } -static void dupe_markdown_range(family_info ** base, int count) +static void dupe_markdown_range(family_info **base, int count) { int bestscore = -999; int bestslot = 0; @@ -960,9 +960,9 @@ static void groupfonts(void) } -static void loadfonts_locale_filter(SDL_Surface * screen, - SDL_Texture * texture, - SDL_Renderer * renderer, const char *const dir, const char *restrict const locale) +static void loadfonts_locale_filter(SDL_Surface *screen, + SDL_Texture *texture, + SDL_Renderer *renderer, const char *const dir, const char *restrict const locale) { char buf[TP_FTW_PATHSIZE]; unsigned dirlen = strlen(dir); @@ -973,14 +973,14 @@ static void loadfonts_locale_filter(SDL_Surface * screen, tp_ftw(screen, texture, renderer, buf, dirlen, 1, loadfont_callback, locale); } -static void loadfonts(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer, const char *const dir) +static void loadfonts(SDL_Surface *screen, SDL_Texture *texture, SDL_Renderer *renderer, const char *const dir) { loadfonts_locale_filter(screen, texture, renderer, dir, NULL); } -/* static */ int load_user_fonts(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, void *vp, const char *restrict const locale) +/* static */ int load_user_fonts(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, void *vp, const char *restrict const locale) { char *homedirdir; @@ -1078,8 +1078,8 @@ static void loadfonts(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer #ifdef FORKED_FONTS -void run_font_scanner(SDL_Surface * screen, SDL_Texture * texture, - SDL_Renderer * renderer, const char *restrict const locale) +void run_font_scanner(SDL_Surface *screen, SDL_Texture *texture, + SDL_Renderer *renderer, const char *restrict const locale) { int sv[2]; int size, i; @@ -1214,7 +1214,7 @@ void run_font_scanner(SDL_Surface * screen, SDL_Texture * texture, } -void receive_some_font_info(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer) +void receive_some_font_info(SDL_Surface *screen, SDL_Texture *texture, SDL_Renderer *renderer) { char *buf = NULL; unsigned buf_size = 0; @@ -1466,7 +1466,7 @@ TuxPaint_Font *getfonthandle(int desire) static int was_bad_font; // see if two font surfaces are the same -static int do_surfcmp(const SDL_Surface * const *const v1, const SDL_Surface * const *const v2) +static int do_surfcmp(const SDL_Surface *const *const v1, const SDL_Surface *const *const v2) { const SDL_Surface *const s1 = *v1; const SDL_Surface *const s2 = *v2; @@ -1544,7 +1544,7 @@ static int surfcmp(const void *s1, const void *s2) } // check if the characters will render distinctly -int charset_works(TuxPaint_Font * font, const char *s) +int charset_works(TuxPaint_Font *font, const char *s) { SDL_Color black = { 0, 0, 0, 0 }; SDLPango_Matrix pango_color; @@ -1608,7 +1608,7 @@ out: return ret; } -int TuxPaint_Font_FontHeight(TuxPaint_Font * tpf) +int TuxPaint_Font_FontHeight(TuxPaint_Font *tpf) { if (tpf == NULL) { @@ -1622,7 +1622,7 @@ int TuxPaint_Font_FontHeight(TuxPaint_Font * tpf) return (tpf->height); } -const char *TuxPaint_Font_FontFaceFamilyName(TuxPaint_Font * tpf) +const char *TuxPaint_Font_FontFaceFamilyName(TuxPaint_Font *tpf) { if (tpf == NULL) { @@ -1651,7 +1651,7 @@ const char *TuxPaint_Font_FontFaceFamilyName(TuxPaint_Font * tpf) return (""); } -const char *TuxPaint_Font_FontFaceStyleName(TuxPaint_Font * tpf) +const char *TuxPaint_Font_FontFaceStyleName(TuxPaint_Font *tpf) { if (tpf == NULL) { @@ -1681,7 +1681,7 @@ const char *TuxPaint_Font_FontFaceStyleName(TuxPaint_Font * tpf) } -void sdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix * pango_color) +void sdl_color_to_pango_color(SDL_Color sdl_color, SDLPango_Matrix *pango_color) { Uint8 pc[4][4]; diff --git a/src/gifenc.c b/src/gifenc.c index 94e44491c..51dadbb0e 100644 --- a/src/gifenc.c +++ b/src/gifenc.c @@ -61,7 +61,7 @@ static Node *new_trie(int degree, int *nkeys) return root; } -static void del_trie(Node * root, int degree) +static void del_trie(Node *root, int degree) { int i; @@ -77,7 +77,7 @@ static void put_loop(ge_GIF * gif, uint16_t loop); #define OR_ABORT if (res == -1) { fprintf(stderr, "Cannot write to GIF\n"); return(NULL); } #define OR_ABORT2 if (res == -1) { fprintf(stderr, "Cannot write to GIF\n"); return; } -ge_GIF *ge_new_gif(const char *fname, uint16_t width, uint16_t height, uint8_t * palette, int depth, int loop) +ge_GIF *ge_new_gif(const char *fname, uint16_t width, uint16_t height, uint8_t *palette, int depth, int loop) { int i, r, g, b, v; ssize_t res; @@ -158,7 +158,7 @@ no_gif: return NULL; } -static void put_loop(ge_GIF * gif, uint16_t loop) +static void put_loop(ge_GIF *gif, uint16_t loop) { ssize_t res; @@ -181,7 +181,7 @@ static void put_loop(ge_GIF * gif, uint16_t loop) /* Add packed key to buffer, updating offset and partial. * gif->offset holds position to put next *bit* * gif->partial holds bits to include in next byte */ -static void put_key(ge_GIF * gif, uint16_t key, int key_size) +static void put_key(ge_GIF *gif, uint16_t key, int key_size) { int byte_offset, bit_offset, bits_to_write; ssize_t res; @@ -207,7 +207,7 @@ static void put_key(ge_GIF * gif, uint16_t key, int key_size) gif->offset = (gif->offset + key_size) % (0xFF * 8); } -static void end_key(ge_GIF * gif) +static void end_key(ge_GIF *gif) { int byte_offset; ssize_t res; @@ -227,7 +227,7 @@ static void end_key(ge_GIF * gif) gif->offset = gif->partial = 0; } -static void put_image(ge_GIF * gif, uint16_t w, uint16_t h, uint16_t x, uint16_t y) +static void put_image(ge_GIF *gif, uint16_t w, uint16_t h, uint16_t x, uint16_t y) { int nkeys, key_size, i, j; Node *node, *child, *root; @@ -288,7 +288,7 @@ static void put_image(ge_GIF * gif, uint16_t w, uint16_t h, uint16_t x, uint16_t del_trie(root, degree); } -static int get_bbox(ge_GIF * gif, uint16_t * w, uint16_t * h, uint16_t * x, uint16_t * y) +static int get_bbox(ge_GIF *gif, uint16_t *w, uint16_t *h, uint16_t *x, uint16_t *y) { int i, j, k; int left, right, top, bottom; @@ -337,7 +337,7 @@ static int get_bbox(ge_GIF * gif, uint16_t * w, uint16_t * h, uint16_t * x, uint * a minimum of `delay` == 6. If `delay` == 0, no delay information will be stored * for the frame. This can be used when creating still (single-frame) GIF images. */ -static void set_delay(ge_GIF * gif, uint16_t d) +static void set_delay(ge_GIF *gif, uint16_t d) { ssize_t res; @@ -351,7 +351,7 @@ static void set_delay(ge_GIF * gif, uint16_t d) OR_ABORT2; } -void ge_add_frame(ge_GIF * gif, uint16_t delay) +void ge_add_frame(ge_GIF *gif, uint16_t delay) { uint16_t w, h, x, y; uint8_t *tmp; @@ -377,7 +377,7 @@ void ge_add_frame(ge_GIF * gif, uint16_t delay) gif->frame = tmp; } -void ge_close_gif(ge_GIF * gif) +void ge_close_gif(ge_GIF *gif) { ssize_t res; diff --git a/src/i18n.c b/src/i18n.c index 9fb0da0be..f78311739 100644 --- a/src/i18n.c +++ b/src/i18n.c @@ -615,7 +615,7 @@ static void show_lang_usage(int exitcode) * @param f File descriptor to write to (e.g., STDOUT or STDERR) * @param prg Program name (e.g., "tuxpaint" or "tuxpaint.exe") */ -static void show_locale_usage(FILE * f, const char *const prg) +static void show_locale_usage(FILE *f, const char *const prg) { /* FIXME: Add accented characters to the descriptions */ fprintf(f, diff --git a/src/im.c b/src/im.c index c796939c9..7d0df3705 100644 --- a/src/im.c +++ b/src/im.c @@ -286,7 +286,7 @@ static int swk_compare(const void *swk1, const void *swk2) /** * Initialize the State Machine. */ -static int sm_init(STATE_MACHINE * sm) +static int sm_init(STATE_MACHINE *sm) { memset(sm, 0, sizeof(STATE_MACHINE)); @@ -305,7 +305,7 @@ static int sm_init(STATE_MACHINE * sm) /** * Free the State Machine resources. */ -static void sm_free(STATE_MACHINE * sm) +static void sm_free(STATE_MACHINE *sm) { if (sm->next) { @@ -331,7 +331,7 @@ static void sm_free(STATE_MACHINE * sm) /** * Double the storage space of the possible transition states. */ -static int sm_dblspace(STATE_MACHINE * sm) +static int sm_dblspace(STATE_MACHINE *sm) { size_t newsize = sm->next_maxsize * 2; SM_WITH_KEY *next = realloc(sm->next, sizeof(SM_WITH_KEY) * newsize); @@ -353,7 +353,7 @@ static int sm_dblspace(STATE_MACHINE * sm) * Return NULL if none is found. The search is done only at 1 level, and does * not recurse deep. */ -static STATE_MACHINE *sm_search_shallow(STATE_MACHINE * sm, char key) +static STATE_MACHINE *sm_search_shallow(STATE_MACHINE *sm, char key) { SM_WITH_KEY smk = { key, NULL }; SM_WITH_KEY *smk_found; @@ -379,8 +379,8 @@ static STATE_MACHINE *sm_search_shallow(STATE_MACHINE * sm, char key) * * @return Found unicode character sequence output of the last state. */ -static const wchar_t *sm_search(STATE_MACHINE * start, wchar_t *key, - int *matched, STATE_MACHINE ** penult, STATE_MACHINE ** end) +static const wchar_t *sm_search(STATE_MACHINE *start, wchar_t *key, + int *matched, STATE_MACHINE **penult, STATE_MACHINE **end) { STATE_MACHINE *sm = sm_search_shallow(start, (char)*key); const wchar_t *unicode; @@ -407,7 +407,7 @@ static const wchar_t *sm_search(STATE_MACHINE * start, wchar_t *key, * Sort the state machine's transition keys so it can be binary-searched. * The sort is done only at 1 level, and does not recurse deep. */ -static void sm_sort_shallow(STATE_MACHINE * sm) +static void sm_sort_shallow(STATE_MACHINE *sm) { qsort(sm->next, sm->next_size, sizeof(SM_WITH_KEY), swk_compare); } @@ -416,7 +416,7 @@ static void sm_sort_shallow(STATE_MACHINE * sm) /** * Add a single sequence-to-unicode path to the state machine. */ -static int sm_add(STATE_MACHINE * sm, char *seq, const wchar_t *unicode, char flag) +static int sm_add(STATE_MACHINE *sm, char *seq, const wchar_t *unicode, char flag) { STATE_MACHINE *sm_found = sm_search_shallow(sm, seq[0]); @@ -486,7 +486,7 @@ static int sm_add(STATE_MACHINE * sm, char *seq, const wchar_t *unicode, char fl /** * Initialize the character map table. */ -static int charmap_init(CHARMAP * cm) +static int charmap_init(CHARMAP *cm) { int error_code = 0; int i = 0; @@ -513,7 +513,7 @@ static int charmap_init(CHARMAP * cm) * * @return 0 if no error, 1 if error. */ -static int charmap_add(CHARMAP * cm, int section, char *seq, const wchar_t *unicode, char *flag) +static int charmap_add(CHARMAP *cm, int section, char *seq, const wchar_t *unicode, char *flag) { if (section >= MAX_SECTIONS) { @@ -538,7 +538,7 @@ static int charmap_add(CHARMAP * cm, int section, char *seq, const wchar_t *unic * @param path The path of the file to load. * @return Zero if the file is loaded fine, nonzero otherwise. */ -static int charmap_load(CHARMAP * cm, const char *path) +static int charmap_load(CHARMAP *cm, const char *path) { FILE *is = NULL; int section = 0; @@ -651,7 +651,7 @@ static int charmap_load(CHARMAP * cm, const char *path) /** * Free the resources used by a character map. */ -static void charmap_free(CHARMAP * cm) +static void charmap_free(CHARMAP *cm) { int i; @@ -667,7 +667,7 @@ static void charmap_free(CHARMAP * cm) /** * Search for a matching character string in the character map. */ -static const wchar_t *charmap_search(CHARMAP * cm, wchar_t *s) +static const wchar_t *charmap_search(CHARMAP *cm, wchar_t *s) { STATE_MACHINE *start; const wchar_t *unicode; @@ -725,7 +725,7 @@ static const wchar_t *charmap_search(CHARMAP * cm, wchar_t *s) * * @see im_read */ -static int im_event_c(IM_DATA * im, SDL_Event event) +static int im_event_c(IM_DATA *im, SDL_Event event) { SDL_Keysym ks = event.key.keysym; @@ -783,7 +783,7 @@ static int im_event_c(IM_DATA * im, SDL_Event event) * @see im_event_c() * @see im_event_fns */ -int im_read(IM_DATA * im, SDL_Event event) +int im_read(IM_DATA *im, SDL_Event event) { IM_EVENT_FN im_event_fp = NULL; int redraw = 0; @@ -838,7 +838,7 @@ int im_read(IM_DATA * im, SDL_Event event) * Generic event handler that calls the appropriate language handler. * im->request should have the event ID. */ -static void im_event(IM_DATA * im) +static void im_event(IM_DATA *im) { SDL_Event event; @@ -852,7 +852,7 @@ static void im_event(IM_DATA * im) /** * Make an event request and call the event handler. */ -static void im_request(IM_DATA * im, int request) +static void im_request(IM_DATA *im, int request) { im->request = request; im_event(im); @@ -866,13 +866,13 @@ static void im_request(IM_DATA * im, int request) /** * Free any allocated resources. */ -static void im_free(IM_DATA * im) +static void im_free(IM_DATA *im) { im_request(im, IM_REQ_FREE); } -void im_softreset(IM_DATA * im) +void im_softreset(IM_DATA *im) { im->s[0] = L'\0'; im->buf[0] = L'\0'; @@ -881,7 +881,7 @@ void im_softreset(IM_DATA * im) } -static void im_fullreset(IM_DATA * im) +static void im_fullreset(IM_DATA *im) { im->s[0] = L'\0'; im->buf[0] = L'\0'; @@ -936,7 +936,7 @@ static void im_fullreset(IM_DATA * im) * * @see im_read */ -static int im_event_zh_tw(IM_DATA * im, SDL_Event event) +static int im_event_zh_tw(IM_DATA *im, SDL_Event event) { SDL_Keysym ks = event.key.keysym; static const char *lang_file = IMDIR "zh_tw.im"; @@ -1159,7 +1159,7 @@ static int im_event_zh_tw(IM_DATA * im, SDL_Event event) * * @see im_read */ -static int im_event_th(IM_DATA * im, SDL_Event event) +static int im_event_th(IM_DATA *im, SDL_Event event) { SDL_Keysym ks = event.key.keysym; static const char *lang_file = IMDIR "th.im"; @@ -1379,7 +1379,7 @@ static int im_event_th(IM_DATA * im, SDL_Event event) * * @see im_read */ -static int im_event_ja(IM_DATA * im, SDL_Event event) +static int im_event_ja(IM_DATA *im, SDL_Event event) { SDL_Keysym ks = event.key.keysym; static const char *lang_file = IMDIR "ja.im"; @@ -1605,7 +1605,7 @@ static int im_event_ja(IM_DATA * im, SDL_Event event) * * @see im_event_ko */ -static int im_event_ko_isvowel(CHARMAP * cm, wchar_t c) +static int im_event_ko_isvowel(CHARMAP *cm, wchar_t c) { STATE_MACHINE *start, *next; const wchar_t *unicode; @@ -1629,7 +1629,7 @@ static int im_event_ko_isvowel(CHARMAP * cm, wchar_t c) * * @see im_read */ -static int im_event_ko(IM_DATA * im, SDL_Event event) +static int im_event_ko(IM_DATA *im, SDL_Event event) { SDL_Keysym ks = event.key.keysym; static const char *lang_file = IMDIR "ko.im"; @@ -1909,7 +1909,7 @@ static int im_event_ko(IM_DATA * im, SDL_Event event) * @param im IM_DATA structure to initialize. * @param lang LANG_* defined constant to initialize the structure with. */ -void im_init(IM_DATA * im, int lang) +void im_init(IM_DATA *im, int lang) { /* Free already allocated resources if initialized before */ if (im_initialized) diff --git a/src/onscreen_keyboard.c b/src/onscreen_keyboard.c index 4fd425ebf..99eee759b 100644 --- a/src/onscreen_keyboard.c +++ b/src/onscreen_keyboard.c @@ -73,7 +73,7 @@ static void print_composemap(osk_composenode * composemap, char *sp); #define wcstombs(tok, wtok, size) WideCharToMultiByte(CP_UTF8,0,wtok,-1,tok,size,NULL,NULL) #endif -static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface * surface) +static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface) { SDL_Surface *tmp; @@ -81,16 +81,16 @@ static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface * surface) return (tmp); } -struct osk_keyboard *osk_create(char *layout_name, SDL_Surface * canvas, - SDL_Surface * BLANK_button_up, - SDL_Surface * BLANK_button_down, - SDL_Surface * BLANK_button_off, - SDL_Surface * BLANK_button_nav, - SDL_Surface * BLANK_button_hold, - SDL_Surface * BLANK_oskdel, - SDL_Surface * BLANK_osktab, - SDL_Surface * BLANK_oskenter, - SDL_Surface * BLANK_oskcapslock, SDL_Surface * BLANK_oskshift, int disable_change) +struct osk_keyboard *osk_create(char *layout_name, SDL_Surface *canvas, + SDL_Surface *BLANK_button_up, + SDL_Surface *BLANK_button_down, + SDL_Surface *BLANK_button_off, + SDL_Surface *BLANK_button_nav, + SDL_Surface *BLANK_button_hold, + SDL_Surface *BLANK_oskdel, + SDL_Surface *BLANK_osktab, + SDL_Surface *BLANK_oskenter, + SDL_Surface *BLANK_oskcapslock, SDL_Surface *BLANK_oskshift, int disable_change) { SDL_Surface *surface; SDL_Surface *button_up, *button_down; @@ -252,7 +252,7 @@ struct osk_keyboard *osk_create(char *layout_name, SDL_Surface * canvas, return keyboard; } -static struct osk_layout *load_layout(on_screen_keyboard * keyboard, char *layout_name) +static struct osk_layout *load_layout(on_screen_keyboard *keyboard, char *layout_name) { FILE *fi; int hlayout_loaded; @@ -381,7 +381,7 @@ static struct osk_layout *load_layout(on_screen_keyboard * keyboard, char *layou /* A hlayout contains the definitions of the keyboard as seen in the screen. Things like the number of rows of the keyboard, the font used to render the keys, the width of the keys, and a code that matches each key like in real hardware keyboards */ -void load_hlayout(osk_layout * layout, char *hlayout_name) +void load_hlayout(osk_layout *layout, char *hlayout_name) { int width, height; int key_number, line_number; @@ -578,7 +578,7 @@ void load_hlayout(osk_layout * layout, char *hlayout_name) /* A keymap contains the keysyms (X keysym mnemonics) associated to each keycode in the hlayout.*/ -void load_keymap(osk_layout * layout, char *keymap_name) +void load_keymap(osk_layout *layout, char *keymap_name) { int i, keycode, readed; char *filename; @@ -678,7 +678,7 @@ void load_keymap(osk_layout * layout, char *keymap_name) } /* Scans a line of keysyms and result and classifies them. */ -static void gettokens(char *line, char *delim, char **pointer, osk_composenode * composenode, osk_layout * layout) +static void gettokens(char *line, char *delim, char **pointer, osk_composenode *composenode, osk_layout *layout) { int i; char *tok; @@ -766,7 +766,7 @@ static void gettokens(char *line, char *delim, char **pointer, osk_composenode * /* A compose map contains the sequences of keysyms (X keysym mnemonics) needed to generate another keysym. The last in the sequence is the result, the others will be searched in the order they appear. They will be classified in a multiway tree.*/ -static void load_composemap(osk_layout * layout, char *composemap_name) +static void load_composemap(osk_layout *layout, char *composemap_name) { char *filename; char **pointer; @@ -822,7 +822,7 @@ static void load_composemap(osk_layout * layout, char *composemap_name) } #ifdef DEBUG_OSK_COMPOSEMAP -static void print_composemap(osk_composenode * composemap, char *sp) +static void print_composemap(osk_composenode *composemap, char *sp) { int i; char *space; @@ -875,7 +875,7 @@ static void print_composemap(osk_composenode * composemap, char *sp) /* This parses the contents of keysymdef.h from the source of xorg. Therefore, if somebody wants to provide custom keysymdefs, he has to follow its syntax. */ -static void load_keysymdefs(osk_layout * layout, char *keysymdefs_name) +static void load_keysymdefs(osk_layout *layout, char *keysymdefs_name) { int i; char *filename; @@ -943,7 +943,7 @@ static void load_keysymdefs(osk_layout * layout, char *keysymdefs_name) /* } */ /* Returns the x keysym corresponding to a mnemonic string */ -static int mnemo2keysym(char *mnemo, on_screen_keyboard * keyboard) +static int mnemo2keysym(char *mnemo, on_screen_keyboard *keyboard) { unsigned int i; @@ -966,7 +966,7 @@ static int mnemo2keysym(char *mnemo, on_screen_keyboard * keyboard) } /* Returns the unicode value of a x keysym if any, otherwise returns 0 */ -static int keysym2unicode(int keysym, on_screen_keyboard * keyboard) +static int keysym2unicode(int keysym, on_screen_keyboard *keyboard) { unsigned int i; @@ -997,7 +997,7 @@ static int keysym2unicode(int keysym, on_screen_keyboard * keyboard) /* Searches in the tree for composing stuff */ -static void get_composed_keysym(on_screen_keyboard * keyboard, osk_composenode * composenode, wchar_t *keysym) +static void get_composed_keysym(on_screen_keyboard *keyboard, osk_composenode *composenode, wchar_t *keysym) { int i; @@ -1102,7 +1102,7 @@ static int is_blank_or_comment(char *line) /* FIXME: Is it safe to supose that if a font is loaded at one size, it will be loaded at any size? */ /* FIXME: starting a layout with one font causes all other layouts be in that font */ -static void keybd_prepare(on_screen_keyboard * keyboard) +static void keybd_prepare(on_screen_keyboard *keyboard) { char *fontname; int font_height; @@ -1178,7 +1178,7 @@ static void keybd_prepare(on_screen_keyboard * keyboard) } -static void apply_surface(int x, int y, SDL_Surface * source, SDL_Surface * destination, SDL_Rect * clip) +static void apply_surface(int x, int y, SDL_Surface *source, SDL_Surface *destination, SDL_Rect *clip) { SDL_Rect offset; @@ -1214,7 +1214,7 @@ static void apply_surface(int x, int y, SDL_Surface * source, SDL_Surface * dest /* } */ /* Stretches a button from the middle, keeping the extrems intact */ -static SDL_Surface *stretch_surface(SDL_Surface * orig, int width) +static SDL_Surface *stretch_surface(SDL_Surface *orig, int width) { int i; SDL_Surface *dest; @@ -1271,7 +1271,7 @@ static SDL_Surface *stretch_surface(SDL_Surface * orig, int width) } /* Draws the keyboard surface */ -static void draw_keyboard(on_screen_keyboard * keyboard) +static void draw_keyboard(on_screen_keyboard *keyboard) { int i, j; int key_height, accumulated_width, accumulated_height; @@ -1307,7 +1307,7 @@ static void draw_keyboard(on_screen_keyboard * keyboard) /* draw_key(keyboard->keymodifiers.dead, keyboard, 0); */ } -static void draw_key(osk_key key, on_screen_keyboard * keyboard, int hot) +static void draw_key(osk_key key, on_screen_keyboard *keyboard, int hot) { char *text; SDL_Surface *skey; @@ -1352,7 +1352,7 @@ static void draw_key(osk_key key, on_screen_keyboard * keyboard, int hot) /* FIXME: TODO draw top and bottom_right (altgr) labels */ -static void label_key(osk_key key, on_screen_keyboard * keyboard) +static void label_key(osk_key key, on_screen_keyboard *keyboard) { SDL_Surface *messager; int modstate; @@ -1455,7 +1455,7 @@ static void label_key(osk_key key, on_screen_keyboard * keyboard) } /* Searches the key corresponding to coordinates */ -static osk_key *find_key(on_screen_keyboard * keyboard, int x, int y) +static osk_key *find_key(on_screen_keyboard *keyboard, int x, int y) { int i, j; osk_key *key; @@ -1478,7 +1478,7 @@ static osk_key *find_key(on_screen_keyboard * keyboard, int x, int y) /* Copies orig to dest or sets dest to defaults if orig is NULL. if firstime is setted, don't frees the strings as there aren't. */ -static void set_key(osk_key * orig, osk_key * dest, int firsttime) +static void set_key(osk_key *orig, osk_key *dest, int firsttime) { if (orig == NULL) { @@ -1522,7 +1522,7 @@ static void set_key(osk_key * orig, osk_key * dest, int firsttime) } } -static char *find_keysym(osk_key key, on_screen_keyboard * keyboard) +static char *find_keysym(osk_key key, on_screen_keyboard *keyboard) { int keycode; char *keysym; @@ -1594,7 +1594,7 @@ static char *find_keysym(osk_key key, on_screen_keyboard * keyboard) } /* We lose the SDL ModState by leaving and entering the tuxpaint window, so using a custom state */ -static int handle_keymods(char *keysym, osk_key * key, on_screen_keyboard * keyboard) +static int handle_keymods(char *keysym, osk_key *key, on_screen_keyboard *keyboard) { SDL_Keymod mod; SDL_Event ev; @@ -1683,7 +1683,7 @@ static int handle_keymods(char *keysym, osk_key * key, on_screen_keyboard * keyb /* set_dead_sticks and clear_dead_sticks deals with the persistence of the keys that are still affecting other key presses. */ -static void set_dead_sticks(osk_key * key, on_screen_keyboard * keyboard) +static void set_dead_sticks(osk_key *key, on_screen_keyboard *keyboard) { key->stick = 1; if (!keyboard->kmdf.dead) @@ -1696,7 +1696,7 @@ static void set_dead_sticks(osk_key * key, on_screen_keyboard * keyboard) keyboard->kmdf.dead4 = key; } -static void clear_dead_sticks(on_screen_keyboard * keyboard) +static void clear_dead_sticks(on_screen_keyboard *keyboard) { if (keyboard->kmdf.dead) { @@ -1720,7 +1720,7 @@ static void clear_dead_sticks(on_screen_keyboard * keyboard) } } -struct osk_keyboard *osk_clicked(on_screen_keyboard * keyboard, int x, int y) +struct osk_keyboard *osk_clicked(on_screen_keyboard *keyboard, int x, int y) { int i; osk_key *key; @@ -1956,7 +1956,7 @@ struct osk_keyboard *osk_clicked(on_screen_keyboard * keyboard, int x, int y) return (keyboard); } -void osk_released(on_screen_keyboard * keyboard) +void osk_released(on_screen_keyboard *keyboard) { osk_key *key; @@ -1971,7 +1971,7 @@ void osk_released(on_screen_keyboard * keyboard) } -static void free_keymap(osk_keymap * keymap) +static void free_keymap(osk_keymap *keymap) { int i; @@ -1989,7 +1989,7 @@ static void free_keymap(osk_keymap * keymap) free(keymap); } -static void free_composemap(osk_composenode * composenode) +static void free_composemap(osk_composenode *composenode) { int i; @@ -2007,7 +2007,7 @@ static void free_composemap(osk_composenode * composenode) free(composenode->keysym); } -static void free_keysymdefs(keysymdefs * ksd, int size) +static void free_keysymdefs(keysymdefs *ksd, int size) { int i; @@ -2015,7 +2015,7 @@ static void free_keysymdefs(keysymdefs * ksd, int size) free(ksd[i].mnemo); } -static void free_keys(osk_layout * layout) +static void free_keys(osk_layout *layout) { int i, j; @@ -2038,7 +2038,7 @@ static void free_keys(osk_layout * layout) free(layout->keys); } -static void free_layout(osk_layout * layout) +static void free_layout(osk_layout *layout) { if (layout->name != NULL) free(layout->name); @@ -2054,7 +2054,7 @@ static void free_layout(osk_layout * layout) free(layout); } -void osk_free(on_screen_keyboard * keyboard) +void osk_free(on_screen_keyboard *keyboard) { free(keyboard->name); free_layout(keyboard->layout); diff --git a/src/pixels.c b/src/pixels.c index 14ac0b32a..d50892170 100644 --- a/src/pixels.c +++ b/src/pixels.c @@ -32,7 +32,7 @@ #include "debug.h" /* Draw a single pixel into the surface: */ -static void putpixel8(SDL_Surface * surface, int x, int y, Uint32 pixel) +static void putpixel8(SDL_Surface *surface, int x, int y, Uint32 pixel) { Uint8 *p; @@ -53,7 +53,7 @@ static void putpixel8(SDL_Surface * surface, int x, int y, Uint32 pixel) } /* Draw a single pixel into the surface: */ -static void putpixel16(SDL_Surface * surface, int x, int y, Uint32 pixel) +static void putpixel16(SDL_Surface *surface, int x, int y, Uint32 pixel) { Uint8 *p; @@ -74,7 +74,7 @@ static void putpixel16(SDL_Surface * surface, int x, int y, Uint32 pixel) } /* Draw a single pixel into the surface: */ -static void putpixel24(SDL_Surface * surface, int x, int y, Uint32 pixel) +static void putpixel24(SDL_Surface *surface, int x, int y, Uint32 pixel) { Uint8 *p; @@ -107,7 +107,7 @@ static void putpixel24(SDL_Surface * surface, int x, int y, Uint32 pixel) } /* Draw a single pixel into the surface: */ -static void putpixel32(SDL_Surface * surface, int x, int y, Uint32 pixel) +static void putpixel32(SDL_Surface *surface, int x, int y, Uint32 pixel) { Uint8 *p; @@ -128,7 +128,7 @@ static void putpixel32(SDL_Surface * surface, int x, int y, Uint32 pixel) } /* Get a pixel: */ -static Uint32 getpixel8(SDL_Surface * surface, int x, int y) +static Uint32 getpixel8(SDL_Surface *surface, int x, int y) { Uint8 *p; @@ -154,7 +154,7 @@ static Uint32 getpixel8(SDL_Surface * surface, int x, int y) } /* Get a pixel: */ -static Uint32 getpixel16(SDL_Surface * surface, int x, int y) +static Uint32 getpixel16(SDL_Surface *surface, int x, int y) { Uint8 *p; @@ -180,7 +180,7 @@ static Uint32 getpixel16(SDL_Surface * surface, int x, int y) } /* Get a pixel: */ -static Uint32 getpixel24(SDL_Surface * surface, int x, int y) +static Uint32 getpixel24(SDL_Surface *surface, int x, int y) { Uint8 *p; Uint32 pixel; @@ -214,7 +214,7 @@ static Uint32 getpixel24(SDL_Surface * surface, int x, int y) } /* Get a pixel: */ -static Uint32 getpixel32(SDL_Surface * surface, int x, int y) +static Uint32 getpixel32(SDL_Surface *surface, int x, int y) { Uint8 *p; diff --git a/src/playsound.c b/src/playsound.c index b39ca9434..705241e01 100644 --- a/src/playsound.c +++ b/src/playsound.c @@ -49,7 +49,7 @@ static int old_sound[4] = { -1, -1, -1, -1 }; * (low values, near the top of the window, are quieter), or * SNDDIST_NEAR for full volume */ -void playsound(SDL_Surface * screen, int chan, int s, int override, int x, int y) +void playsound(SDL_Surface *screen, int chan, int s, int override, int x, int y) { #ifndef NOSOUND int left, dist; diff --git a/src/postscript_print.c b/src/postscript_print.c index de698b7a2..e3432334d 100644 --- a/src/postscript_print.c +++ b/src/postscript_print.c @@ -77,8 +77,7 @@ static int f2dec(float f) } /* Actually save the PostScript data to the file stream: */ -int do_ps_save(FILE * fi, - const char *restrict const fname, SDL_Surface * surf, const char *restrict pprsize, int is_pipe) +int do_ps_save(FILE *fi, const char *restrict const fname, SDL_Surface *surf, const char *restrict pprsize, int is_pipe) { const struct paper *ppr; int img_w = surf->w; diff --git a/src/progressbar.c b/src/progressbar.c index 9a7db5a1d..ae0f5e13e 100644 --- a/src/progressbar.c +++ b/src/progressbar.c @@ -39,7 +39,7 @@ int progress_bar_disabled, prog_bar_ctr; * * @param screen Screen surface */ -void show_progress_bar_(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer) +void show_progress_bar_(SDL_Surface *screen, SDL_Texture *texture, SDL_Renderer *renderer) { SDL_Rect dest, src, r; int x; diff --git a/src/tuxpaint.c b/src/tuxpaint.c index b54d68395..f73f672c8 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -977,7 +977,7 @@ static void setup_normal_screen_layout(void) * @param r The rectange * @param name The name of the rect object */ -static void debug_rect(SDL_Rect * r, char *name) +static void debug_rect(SDL_Rect *r, char *name) { /* FIXME: Send to stderr, not stdout? */ printf("%-12s %dx%d @ %d,%d\n", name, r->w, r->h, r->x, r->y); @@ -992,7 +992,7 @@ static void debug_rect(SDL_Rect * r, char *name) * @param g The grid * @param name The name of the grid object */ -static void debug_dims(grid_dims * g, char *name) +static void debug_dims(grid_dims *g, char *name) { /* FIXME: Send to stderr, not stdout? */ printf("%-12s %dx%d\n", name, g->cols, g->rows); @@ -1062,7 +1062,7 @@ static void SDL_WarpMouse(Uint16 x, Uint16 y) SDL_WarpMouseInWindow(window_screen, x, y); } -static SDL_Surface *SDL_DisplayFormat(SDL_Surface * surface) +static SDL_Surface *SDL_DisplayFormat(SDL_Surface *surface) { SDL_Surface *tmp; @@ -1070,7 +1070,7 @@ static SDL_Surface *SDL_DisplayFormat(SDL_Surface * surface) return (tmp); } -static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface * surface) +static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface) { SDL_Surface *tmp; @@ -1078,7 +1078,7 @@ static SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface * surface) return (tmp); } -static void SDL_Flip(SDL_Surface * screen) +static void SDL_Flip(SDL_Surface *screen) { //SDL_UpdateWindowSurface(window_screen); SDL_UpdateTexture(texture, NULL, screen->pixels, screen->pitch); @@ -1087,7 +1087,7 @@ static void SDL_Flip(SDL_Surface * screen) SDL_RenderPresent(renderer); } -static void SDL_UpdateRect(SDL_Surface * screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h) +static void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h) { SDL_Rect r; @@ -1105,7 +1105,7 @@ static void SDL_UpdateRect(SDL_Surface * screen, Sint32 x, Sint32 y, Sint32 w, S SDL_RenderPresent(renderer); } -static void show_progress_bar(SDL_Surface * screen) +static void show_progress_bar(SDL_Surface *screen) { show_progress_bar_(screen, texture, renderer); } @@ -1174,7 +1174,7 @@ static void update_screen(int x1, int y1, int x2, int y2) * * @param r The rect */ -static void update_screen_rect(SDL_Rect * r) +static void update_screen_rect(SDL_Rect *r) { SDL_UpdateRect(screen, r->x, r->y, r->w, r->h); } @@ -1188,7 +1188,7 @@ static void update_screen_rect(SDL_Rect * r) * @param y Y coordinate * @return true if a hit, else false */ -static int hit_test(const SDL_Rect * const r, unsigned x, unsigned y) +static int hit_test(const SDL_Rect *const r, unsigned x, unsigned y) { /* note the use of unsigned math: no need to check for negative */ return (x - (unsigned)r->x < (unsigned)r->w) && (y - (unsigned)r->y < (unsigned)r->h); @@ -1206,7 +1206,7 @@ static int hit_test(const SDL_Rect * const r, unsigned x, unsigned y) * @param gd The grid of items * @returns The item clicked, or -1 if click was outside the grid. */ -static int grid_hit_gd(const SDL_Rect * const r, unsigned x, unsigned y, grid_dims * gd) +static int grid_hit_gd(const SDL_Rect *const r, unsigned x, unsigned y, grid_dims *gd) { unsigned item_w = r->w / gd->cols; unsigned item_h = r->h / gd->rows; @@ -1717,7 +1717,7 @@ static SDL_Surface *zoom(SDL_Surface * src, int new_x, int new_y); * @param color The color to draw it in * @return A new surface, containing the rendered text */ -static SDL_Surface *render_text(TuxPaint_Font * restrict font, const char *restrict str, SDL_Color color) +static SDL_Surface *render_text(TuxPaint_Font *restrict font, const char *restrict str, SDL_Color color) { SDL_Surface *ret = NULL; int height; @@ -1806,7 +1806,7 @@ static Uint16 *wcstou16(const wchar_t *str) * @param color The color to draw it in * @return A new surface, containing the rendered text */ -static SDL_Surface *render_text_w(TuxPaint_Font * restrict font, const wchar_t *restrict str, SDL_Color color) +static SDL_Surface *render_text_w(TuxPaint_Font *restrict font, const wchar_t *restrict str, SDL_Color color) { SDL_Surface *ret = NULL; int height; @@ -1975,8 +1975,7 @@ enum static SDL_Surface *img_cur_brush; static int img_cur_brush_frame_w, img_cur_brush_w, img_cur_brush_h, - img_cur_brush_frames, img_cur_brush_directional, img_cur_brush_rotate, - img_cur_brush_chaotic, img_cur_brush_spacing; + img_cur_brush_frames, img_cur_brush_directional, img_cur_brush_rotate, img_cur_brush_chaotic, img_cur_brush_spacing; static int brush_counter, brush_frame; enum @@ -5524,7 +5523,8 @@ static void mainloop(void) else { draw_color = SDL_MapRGB(canvas->format, - color_hexes[cur_color][0], color_hexes[cur_color][1], color_hexes[cur_color][2]); + color_hexes[cur_color][0], color_hexes[cur_color][1], + color_hexes[cur_color][2]); } would_fill = would_flood_fill(canvas, draw_color, canv_color); @@ -5558,8 +5558,7 @@ static void mainloop(void) } } - if (cur_fill == FILL_FLOOD || - (cur_fill == FILL_ERASER && img_starter_bkgd == NULL)) + if (cur_fill == FILL_FLOOD || (cur_fill == FILL_ERASER && img_starter_bkgd == NULL)) { /* Flood fill a solid color */ @@ -5621,6 +5620,7 @@ static void mainloop(void) else if (cur_fill == FILL_ERASER) { void (*putpixel)(SDL_Surface *, int, int, Uint32) = putpixels[canvas->format->BytesPerPixel]; + Uint32(*getpixel) (SDL_Surface *, int, int) = getpixels[img_starter_bkgd->format->BytesPerPixel]; int x, y; @@ -5632,7 +5632,7 @@ static void mainloop(void) for (y = sim_flood_y1; y <= sim_flood_y2; y++) { - for (x = sim_flood_x1; x <= sim_flood_x2; x++) + for (x = sim_flood_x1; x <= sim_flood_x2; x++) { if (sim_flood_touched[y * canvas->w + x]) { @@ -6040,14 +6040,14 @@ static void mainloop(void) debug("Playing description sound..."); #ifndef NOSOUND - Mix_ChannelFinished(NULL); /* Kill the callback, so we don't get stuck in a loop! */ + Mix_ChannelFinished(NULL); /* Kill the callback, so we don't get stuck in a loop! */ if (event.user.data1 != NULL) { - if ((int)(intptr_t) event.user.data1 == cur_stamp[stamp_group]) /* Don't play old stamp's sound... *///EP added (intptr_t) to avoid warning on x64 + if ((int)(intptr_t) event.user.data1 == cur_stamp[stamp_group]) /* Don't play old stamp's sound... *///EP added (intptr_t) to avoid warning on x64 { - if (!mute && stamp_data[stamp_group][(int)(intptr_t) event.user.data1]->sdesc != NULL) //EP added (intptr_t) to avoid warning on x64 - Mix_PlayChannel(2, stamp_data[stamp_group][(int)(intptr_t) event.user.data1]->sdesc, //EP added (intptr_t) to avoid warning on x64 + if (!mute && stamp_data[stamp_group][(int)(intptr_t) event.user.data1]->sdesc != NULL) //EP added (intptr_t) to avoid warning on x64 + Mix_PlayChannel(2, stamp_data[stamp_group][(int)(intptr_t) event.user.data1]->sdesc, //EP added (intptr_t) to avoid warning on x64 0); } } @@ -7202,7 +7202,7 @@ static void brush_draw(int x1, int y1, int x2, int y2, int update) if (brushes_chaotic[cur_brush]) { - r = (float) (rand() % 36) * 10.0; + r = (float)(rand() % 36) * 10.0; } dx = x2 - x1; @@ -7390,14 +7390,15 @@ static void blit_brush(int x, int y, int direction, double rotation, int *w, int { SDL_Surface *brush_frame_surf; - brush_frame_surf = - SDL_CreateRGBSurface(0, src.w, src.h, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000); + brush_frame_surf = SDL_CreateRGBSurface(0, src.w, src.h, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000); if (brush_frame_surf != NULL) { /* Ensure any semi-transparent areas or edges match the same color as we're painting (and not cause a black halo; see https://sourceforge.net/p/tuxpaint/bugs/259/ -bjk 2024.10.11) */ - SDL_FillRect(brush_frame_surf, NULL, SDL_MapRGBA(brush_frame_surf->format, color_hexes[cur_color][0], color_hexes[cur_color][1], color_hexes[cur_color][2], 0)); + SDL_FillRect(brush_frame_surf, NULL, + SDL_MapRGBA(brush_frame_surf->format, color_hexes[cur_color][0], color_hexes[cur_color][1], + color_hexes[cur_color][2], 0)); /* 2021/09/28 SDL(2)_gfxBlitRGBA() is not available in the SDL2_gfx library, using plain SDL_BlitSurface() instead. Pere SDL_gfxBlitRGBA(img_cur_brush, &src, brush_frame_surf, NULL); */ @@ -7466,7 +7467,7 @@ typedef struct multichan /** * FIXME */ -static void fill_multichan(multichan * mc, double *up, double *vp) +static void fill_multichan(multichan *mc, double *up, double *vp) { double X, Y, Z, u, v; double u_prime, v_prime; /* temp, part of official formula */ @@ -7502,7 +7503,7 @@ static void fill_multichan(multichan * mc, double *up, double *vp) /** * FIXME */ -static double tint_part_1(multichan * work, SDL_Surface * in) +static double tint_part_1(multichan *work, SDL_Surface *in) { int xx, yy; double u_total = 0; @@ -7546,7 +7547,7 @@ static double tint_part_1(multichan * work, SDL_Surface * in) /** * FIXME */ -static void change_colors(SDL_Surface * out, multichan * work, double hue_range, multichan * key_color_ptr) +static void change_colors(SDL_Surface *out, multichan *work, double hue_range, multichan *key_color_ptr) { double lower_hue_1, upper_hue_1, lower_hue_2, upper_hue_2; int xx, yy; @@ -7654,7 +7655,7 @@ static void change_colors(SDL_Surface * out, multichan * work, double hue_range, /** * FIXME */ -static multichan *find_most_saturated(double initial_hue, multichan * work, unsigned num, double *hue_range_ptr) +static multichan *find_most_saturated(double initial_hue, multichan *work, unsigned num, double *hue_range_ptr) { /* find the most saturated pixel near the initial hue guess */ multichan *key_color_ptr = NULL; @@ -7731,7 +7732,7 @@ hue_range_retry:; /** * FIXME */ -static void vector_tint_surface(SDL_Surface * out, SDL_Surface * in) +static void vector_tint_surface(SDL_Surface *out, SDL_Surface *in) { int xx, yy; @@ -7768,7 +7769,7 @@ static void vector_tint_surface(SDL_Surface * out, SDL_Surface * in) * @param tmp_surf Destination surface * @param surf_ptr Source surface */ -static void tint_surface(SDL_Surface * tmp_surf, SDL_Surface * surf_ptr) +static void tint_surface(SDL_Surface *tmp_surf, SDL_Surface *surf_ptr) { unsigned width = surf_ptr->w; unsigned height = surf_ptr->h; @@ -8367,11 +8368,10 @@ static unsigned compute_default_scale_factor(double ratio) * @param i Counter * @param locale UI's locale, for loading localized text (ignored) */ -static void loadbrush_callback(SDL_Surface * screen, - __attribute__((unused)) SDL_Texture * texture, - __attribute__((unused)) SDL_Renderer * - renderer, const char *restrict const dir, - unsigned dirlen, tp_ftw_str * files, unsigned i, const char *restrict const locale) +static void loadbrush_callback(SDL_Surface *screen, + __attribute__((unused)) SDL_Texture *texture, + __attribute__((unused)) SDL_Renderer *renderer, const char *restrict const dir, + unsigned dirlen, tp_ftw_str *files, unsigned i, const char *restrict const locale) { FILE *fi; char buf[64]; @@ -8508,7 +8508,7 @@ static void loadbrush_callback(SDL_Surface * screen, /** * FIXME */ -static void load_brush_dir(SDL_Surface * screen, const char *restrict const dir) +static void load_brush_dir(SDL_Surface *screen, const char *restrict const dir) { char buf[TP_FTW_PATHSIZE]; unsigned dirlen = strlen(dir); @@ -8520,7 +8520,7 @@ static void load_brush_dir(SDL_Surface * screen, const char *restrict const dir) /** * FIXME */ -SDL_Surface *mirror_surface(SDL_Surface * s) +SDL_Surface *mirror_surface(SDL_Surface *s) { SDL_Surface *new_surf; int x; @@ -8560,7 +8560,7 @@ SDL_Surface *mirror_surface(SDL_Surface * s) /** * FIXME */ -SDL_Surface *flip_surface(SDL_Surface * s) +SDL_Surface *flip_surface(SDL_Surface *s) { SDL_Surface *new_surf; int y; @@ -8602,7 +8602,7 @@ static unsigned default_stamp_size; /** * FIXME */ -static void loadstamp_finisher(stamp_type * sd, unsigned w, unsigned h, double ratio) +static void loadstamp_finisher(stamp_type *sd, unsigned w, unsigned h, double ratio) { unsigned int upper = HARD_MAX_STAMP_SIZE; unsigned int underscanned_upper = HARD_MAX_STAMP_SIZE; @@ -8958,7 +8958,7 @@ static void set_active_stamp(void) /** * FIXME */ -static void get_stamp_thumb(stamp_type * sd, int process_sound) +static void get_stamp_thumb(stamp_type *sd, int process_sound) { SDL_Surface *bigimg = NULL; unsigned len = strlen(sd->stampname); @@ -9281,11 +9281,10 @@ static void get_stamp_thumb(stamp_type * sd, int process_sound) * @param i Counter * @param locale UI's locale, for loading localized text (ignored) */ -static void loadstamp_callback(SDL_Surface * screen, - __attribute__((unused)) SDL_Texture * texture, - __attribute__((unused)) SDL_Renderer * - renderer, const char *restrict const dir, - unsigned dirlen, tp_ftw_str * files, unsigned i, const char *restrict const locale) +static void loadstamp_callback(SDL_Surface *screen, + __attribute__((unused)) SDL_Texture *texture, + __attribute__((unused)) SDL_Renderer *renderer, const char *restrict const dir, + unsigned dirlen, tp_ftw_str *files, unsigned i, const char *restrict const locale) { (void)locale; @@ -9411,7 +9410,7 @@ static void loadstamp_callback(SDL_Surface * screen, /** * FIXME */ -static void load_stamp_dir(SDL_Surface * screen, const char *const dir) +static void load_stamp_dir(SDL_Surface *screen, const char *const dir) { char buf[TP_FTW_PATHSIZE]; unsigned dirlen = strlen(dir); @@ -9424,7 +9423,7 @@ static void load_stamp_dir(SDL_Surface * screen, const char *const dir) /** * FIXME */ -static void load_stamps(SDL_Surface * screen) +static void load_stamps(SDL_Surface *screen) { char *homedirdir = get_fname("stamps", DIR_DATA); @@ -9491,7 +9490,7 @@ volatile long fontconfig_thread_done = 0; /** * FIXME */ -int generate_fontconfig_cache_spinner(SDL_Surface * screen) +int generate_fontconfig_cache_spinner(SDL_Surface *screen) { SDL_Event event; @@ -9810,7 +9809,7 @@ static SDL_Surface *do_render_button_label(const char *const label) } #if 0 -static SDL_Surface *crop_surface(SDL_Surface * surf) +static SDL_Surface *crop_surface(SDL_Surface *surf) { int top, bottom, left, right, x, y, w, h; Uint8 r, g, b, a, r1, g1, b1, a1; @@ -11813,7 +11812,7 @@ static void draw_fills(void) * FIXME */ /* Create a thumbnail: */ -static SDL_Surface *thumbnail(SDL_Surface * src, int max_x, int max_y, int keep_aspect) +static SDL_Surface *thumbnail(SDL_Surface *src, int max_x, int max_y, int keep_aspect) { return (thumbnail2(src, max_x, max_y, keep_aspect, 1)); } @@ -11821,7 +11820,7 @@ static SDL_Surface *thumbnail(SDL_Surface * src, int max_x, int max_y, int keep_ /** * FIXME */ -static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y, int keep_aspect, int keep_alpha) +static SDL_Surface *thumbnail2(SDL_Surface *src, int max_x, int max_y, int keep_aspect, int keep_alpha) { int x, y; float src_x, src_y, off_x, off_y; @@ -11999,7 +11998,7 @@ static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y, int keep */ /* Based on code from: http://www.codeproject.com/cs/media/imageprocessing4.asp copyright 2002 Christian Graus */ -static SDL_Surface *zoom(SDL_Surface * src, int new_w, int new_h) +static SDL_Surface *zoom(SDL_Surface *src, int new_w, int new_h) { SDL_Surface *s; void (*putpixel)(SDL_Surface *, int, int, Uint32); @@ -12159,7 +12158,7 @@ static SDL_Surface *zoom(SDL_Surface * src, int new_w, int new_h) /* XOR must show up on black, white, 0x7f grey, and 0x80 grey. XOR must be exactly 100% perfectly reversable. */ -static void _xorpixel(SDL_Surface * surf, int x, int y) +static void _xorpixel(SDL_Surface *surf, int x, int y) { Uint8 *p; int BytesPerPixel; @@ -13412,7 +13411,7 @@ static void strip_quotes(char *buf) /** * FIXME */ -static char *loaddesc(const char *const fname, Uint8 * locale_text) +static char *loaddesc(const char *const fname, Uint8 *locale_text) { char *txt_fname, *extptr; char buf[512], def_buf[512]; /* doubled to 512 per TOYAMA Shin-Ichi's requested; -bjk 2007.05.10 */ @@ -13526,7 +13525,7 @@ static char *loaddesc(const char *const fname, Uint8 * locale_text) * FIXME */ /* Load a *.dat file */ -static double loadinfo(const char *const fname, stamp_type * inf) +static double loadinfo(const char *const fname, stamp_type *inf) { char buf[256]; FILE *fi; @@ -13638,7 +13637,7 @@ static double loadinfo(const char *const fname, stamp_type * inf) /** * FIXME */ -static int SDLCALL NondefectiveBlit(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect) +static int SDLCALL NondefectiveBlit(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) { int dstx = 0; int dsty = 0; @@ -13708,10 +13707,9 @@ static int SDLCALL NondefectiveBlit(SDL_Surface * src, const SDL_Rect * srcrect, * @param SDL_Surface * dst -- destination surface * @param int SDCALL(*blit) -- function for blitting; "NondefectiveBlit" or "SDL_BlitSurface" */ -static void autoscale_copy_smear_free(SDL_Surface * src, SDL_Surface * dst, - int SDLCALL(*blit) (SDL_Surface * src, - const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect)) +static void autoscale_copy_smear_free(SDL_Surface *src, SDL_Surface *dst, + int SDLCALL(*blit) (SDL_Surface *src, + const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)) { SDL_Surface *src1; SDL_Rect dest; @@ -13795,11 +13793,11 @@ static void autoscale_copy_smear_free(SDL_Surface * src, SDL_Surface * dst, * @param int SDCALL(*blit) -- function for blitting; "NondefectiveBlit" or "SDL_BlitSurface" * @param starter_template_options_t opts -- options (loaded from ".dat" file) describing strategies to take */ -static void autoscale_copy_scale_or_smear_free(SDL_Surface * src, SDL_Surface * dst, - int SDLCALL(*blit) (SDL_Surface * src, - const SDL_Rect * srcrect, - SDL_Surface * dst, - SDL_Rect * dstrect), starter_template_options_t opts) +static void autoscale_copy_scale_or_smear_free(SDL_Surface *src, SDL_Surface *dst, + int SDLCALL(*blit) (SDL_Surface *src, + const SDL_Rect *srcrect, + SDL_Surface *dst, + SDL_Rect *dstrect), starter_template_options_t opts) { int new_w, new_h; float src_aspect, dst_aspect; @@ -13974,7 +13972,7 @@ static void autoscale_copy_scale_or_smear_free(SDL_Surface * src, SDL_Surface * * @param char * img_id -- basename of image * @param starter_template_options_t * opts -- pointer to options struct to fill */ -static void get_starter_template_options(char *dirname, char *img_id, starter_template_options_t * opts) +static void get_starter_template_options(char *dirname, char *img_id, starter_template_options_t *opts) { char fname[256], buf[256]; char *arg; @@ -14181,7 +14179,7 @@ static void get_starter_template_options(char *dirname, char *img_id, starter_te /** * FIXME */ -static void load_starter_id(char *saved_id, FILE * fil) +static void load_starter_id(char *saved_id, FILE *fil) { char *rname; char fname[FILENAME_MAX]; @@ -14274,7 +14272,7 @@ static void load_starter_id(char *saved_id, FILE * fil) * FIXME */ static SDL_Surface *load_starter_helper(char *path_and_basename, - const char *extension, SDL_Surface * (*load_func) (const char *)) + const char *extension, SDL_Surface *(*load_func) (const char *)) { char *ext; char fname[256]; @@ -14805,8 +14803,8 @@ static int do_prompt_snd(const char *const text, const char *const btn_yes, * FIXME */ static int do_prompt_image(const char *const text, const char *const btn_yes, - const char *const btn_no, SDL_Surface * img1, - SDL_Surface * img2, SDL_Surface * img3, int ox, int oy) + const char *const btn_no, SDL_Surface *img1, + SDL_Surface *img2, SDL_Surface *img3, int ox, int oy) { return (do_prompt_image_snd(text, btn_yes, btn_no, img1, img2, img3, SND_NONE, ox, oy)); } @@ -14816,8 +14814,8 @@ static int do_prompt_image(const char *const text, const char *const btn_yes, */ static int do_prompt_image_snd(const char *const text, const char *const btn_yes, - const char *const btn_no, SDL_Surface * img1, - SDL_Surface * img2, SDL_Surface * img3, int snd, int ox, int oy) + const char *const btn_no, SDL_Surface *img1, + SDL_Surface *img2, SDL_Surface *img3, int snd, int ox, int oy) { return (do_prompt_image_flash_snd(text, btn_yes, btn_no, img1, img2, img3, 0, snd, ox, oy)); } @@ -14827,8 +14825,8 @@ static int do_prompt_image_snd(const char *const text, */ static int do_prompt_image_flash(const char *const text, const char *const btn_yes, - const char *const btn_no, SDL_Surface * img1, - SDL_Surface * img2, SDL_Surface * img3, int animate, int ox, int oy) + const char *const btn_no, SDL_Surface *img1, + SDL_Surface *img2, SDL_Surface *img3, int animate, int ox, int oy) { return (do_prompt_image_flash_snd(text, btn_yes, btn_no, img1, img2, img3, animate, SND_NONE, ox, oy)); } @@ -14842,8 +14840,8 @@ static int do_prompt_image_flash(const char *const text, static int do_prompt_image_flash_snd(const char *const text, const char *const btn_yes, const char *const btn_no, - SDL_Surface * img1, SDL_Surface * img2, - SDL_Surface * img3, int animate, int snd, int ox, int oy) + SDL_Surface *img1, SDL_Surface *img2, + SDL_Surface *img3, int animate, int snd, int ox, int oy) { int oox, ooy, nx, ny; SDL_Event event; @@ -15704,7 +15702,7 @@ static void cleanup(void) /** * FIXME */ -static void free_surface(SDL_Surface ** surface_array) +static void free_surface(SDL_Surface **surface_array) { if (surface_array) //EP added this line to avoid app crash if (*surface_array) @@ -15718,7 +15716,7 @@ static void free_surface(SDL_Surface ** surface_array) /** * FIXME */ -static void free_surface_array(SDL_Surface * surface_array[], int count) +static void free_surface_array(SDL_Surface *surface_array[], int count) { int i; @@ -16433,7 +16431,7 @@ static int do_save(int tool, int dont_show_success_results, int autosave) * FIXME */ static void set_chunk_data(unsigned char **chunk_data, size_t *chunk_data_len, - size_t uncompressed_size, Bytef * data, size_t dataLen) + size_t uncompressed_size, Bytef *data, size_t dataLen) { int headersLen; unsigned int i; @@ -16888,7 +16886,7 @@ static void do_png_embed_data(png_structp png_ptr) * FIXME */ /* Actually save the PNG data to the file stream: */ -static int do_png_save(FILE * fi, const char *const fname, SDL_Surface * surf, int embed) +static int do_png_save(FILE *fi, const char *const fname, SDL_Surface *surf, int embed) { png_structp png_ptr; png_infop info_ptr; @@ -19971,7 +19969,7 @@ static void rgbtohsv(Uint8 r8, Uint8 g8, Uint8 b8, float *h, float *s, float *v) /** * FIXME */ -static void hsvtorgb(float h, float s, float v, Uint8 * r8, Uint8 * g8, Uint8 * b8) +static void hsvtorgb(float h, float s, float v, Uint8 *r8, Uint8 *g8, Uint8 *b8) { int i; float f, p, q, t, r, g, b; @@ -20654,7 +20652,7 @@ static void draw_image_title(int t, SDL_Rect dest) /* Handle keyboard events to control the mouse: */ /* Move as many pixels as bigsteps outside the areas, in the areas and 5 pixels around, move 1 pixel at a time */ -static void handle_keymouse(SDLKey key, Uint32 updown, int steps, SDL_Rect * area1, SDL_Rect * area2) +static void handle_keymouse(SDLKey key, Uint32 updown, int steps, SDL_Rect *area1, SDL_Rect *area2) { int left, right, up, bottom; SDL_Event event; @@ -20952,7 +20950,7 @@ static void handle_keymouse_buttons(SDLKey key, int *whicht, int *whichc, SDL_Re * FIXME */ /* Unblank screen in fullscreen mode, if needed: */ -static void handle_active(SDL_Event * event) +static void handle_active(SDL_Event *event) { if (event->window.event == SDL_WINDOWEVENT_EXPOSED || SDL_WINDOWEVENT_RESTORED) { @@ -20980,7 +20978,7 @@ static void handle_active(SDL_Event * event) /** * FIXME */ -static SDL_Surface *duplicate_surface(SDL_Surface * orig) +static SDL_Surface *duplicate_surface(SDL_Surface *orig) { /* Uint32 amask; @@ -22046,8 +22044,9 @@ static void load_magic_plugins(void) { if (magics[group][j].order == magics[group][idx].order) { - fprintf(stderr, "Warning: In group %d, tool %d (%s) has the same order (%d) as tool %d (%s)\n", - group, idx, magics[group][idx].name, magics[group][j].order, j, magics[group][j].name); + fprintf(stderr, + "Warning: In group %d, tool %d (%s) has the same order (%d) as tool %d (%s)\n", group, + idx, magics[group][idx].name, magics[group][j].order, j, magics[group][j].name); } } @@ -22246,8 +22245,8 @@ static void update_progress_bar(void) * FIXME */ static void magic_line_func(void *mapi, - int which, SDL_Surface * canvas, - SDL_Surface * last, int x1, int y1, int x2, + int which, SDL_Surface *canvas, + SDL_Surface *last, int x1, int y1, int x2, int y2, int step, void (*cb)(void *, int, SDL_Surface *, SDL_Surface *, int, int)) { int dx, dy, y; @@ -22377,7 +22376,7 @@ static void magic_stopsound(void) /** * FIXME */ -static void magic_playsound(Mix_Chunk * snd, int left_right, int up_down) +static void magic_playsound(Mix_Chunk *snd, int left_right, int up_down) { #ifndef NOSOUND @@ -22431,6 +22430,7 @@ static int magic_playingsound(void) { #ifndef NOSOUND int is_playing; + is_playing = Mix_Playing(0); return is_playing; #endif @@ -22477,7 +22477,7 @@ static int magic_button_down(void) /** * FIXME */ -static SDL_Surface *magic_scale(SDL_Surface * surf, int w, int h, int aspect) +static SDL_Surface *magic_scale(SDL_Surface *surf, int w, int h, int aspect) { return (thumbnail2(surf, w, h, aspect, 1)); } @@ -22485,7 +22485,7 @@ static SDL_Surface *magic_scale(SDL_Surface * surf, int w, int h, int aspect) /** * FIXME */ -static SDL_Surface *magic_rotate_scale(SDL_Surface * surf, int r, int w) +static SDL_Surface *magic_rotate_scale(SDL_Surface *surf, int r, int w) { return (rotozoomSurface(surf, r, (float)w / surf->w, SMOOTHING_ON)); } @@ -23853,7 +23853,7 @@ static int do_new_dialog(void) normally appears at the beginning (above Starts & Templates), but may be placed at the end with the "--newcolorslast" option. */ -static int do_new_dialog_add_colors(SDL_Surface * *thumbs, int num_files, +static int do_new_dialog_add_colors(SDL_Surface **thumbs, int num_files, int *d_places, char * *d_names, char * *d_exts, int *white_in_palette) { int j; @@ -26286,7 +26286,7 @@ static void draw_color_mixer_tooltip(void) * @param int the_color - the color within the palette (e.g., COLOR_PICKER) (its RGB values will be grabbed via global color_hexes[], and the new button will be rendered into the appropriate img_color_btns[]) * @param SDL_Surface * icon - a bitmap to be applied to the button (or NULL if none) (e.g., the pipette icon that appears over the color selector) */ -static void render_color_button(int the_color, SDL_Surface * icon) +static void render_color_button(int the_color, SDL_Surface *icon) { SDL_Surface *tmp_btn_up, *tmp_btn_down; SDL_Rect dest; @@ -26486,7 +26486,7 @@ static void magic_set_size() /** * FIXME */ -static void magic_putpixel(SDL_Surface * surface, int x, int y, Uint32 pixel) +static void magic_putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel) { putpixels[surface->format->BytesPerPixel] (surface, x, y, pixel); } @@ -26494,7 +26494,7 @@ static void magic_putpixel(SDL_Surface * surface, int x, int y, Uint32 pixel) /** * FIXME */ -static Uint32 magic_getpixel(SDL_Surface * surface, int x, int y) +static Uint32 magic_getpixel(SDL_Surface *surface, int x, int y) { return (getpixels[surface->format->BytesPerPixel] (surface, x, y)); } @@ -26502,7 +26502,7 @@ static Uint32 magic_getpixel(SDL_Surface * surface, int x, int y) /** * FIXME */ -static void magic_xorpixel(SDL_Surface * surface, int x, int y) +static void magic_xorpixel(SDL_Surface *surface, int x, int y) { _xorpixel(surface, x, y); } @@ -26511,7 +26511,7 @@ static void magic_xorpixel(SDL_Surface * surface, int x, int y) /** * FIXME */ -static void magic_switchout(SDL_Surface * last) +static void magic_switchout(SDL_Surface *last) { int was_clicking = 0; @@ -26550,7 +26550,7 @@ static void magic_switchout(SDL_Surface * last) /** * FIXME */ -static void magic_switchin(SDL_Surface * last) +static void magic_switchin(SDL_Surface *last) { if (cur_tool == TOOL_MAGIC) { @@ -26587,7 +26587,7 @@ static int magic_modeint(int mode) /** * FIXME */ -static void add_label_node(int w, int h, Uint16 x, Uint16 y, SDL_Surface * label_node_surface) +static void add_label_node(int w, int h, Uint16 x, Uint16 y, SDL_Surface *label_node_surface) { struct label_node *new_node = malloc(sizeof(struct label_node)); struct label_node *aux_node; @@ -27006,7 +27006,7 @@ static void delete_label_list(struct label_node **ref_head) */ /* A custom bliter that allows to put two transparent layers toghether without having to deal with colorkeys or SDL_SRCALPHA I am always reinventing the wheel. Hope this one is not squared. Pere */ -static void myblit(SDL_Surface * src_surf, SDL_Rect * src_rect, SDL_Surface * dest_surf, SDL_Rect * dest_rect) +static void myblit(SDL_Surface *src_surf, SDL_Rect *src_rect, SDL_Surface *dest_surf, SDL_Rect *dest_rect) { int x, y; Uint8 src_r, src_g, src_b, src_a; @@ -27054,7 +27054,7 @@ static void myblit(SDL_Surface * src_surf, SDL_Rect * src_rect, SDL_Surface * de /** * FIXME */ -static void load_info_about_label_surface(FILE * lfi) +static void load_info_about_label_surface(FILE *lfi) { struct label_node *new_node; int list_ctr; @@ -27674,7 +27674,7 @@ int chunk_is_valid(const char *chunk_name, png_unknown_chunk unknown) /** * FIXME */ -Bytef *get_chunk_data(FILE * fp, char *fname, png_structp png_ptr, +Bytef *get_chunk_data(FILE *fp, char *fname, png_structp png_ptr, png_infop info_ptr, const char *chunk_name, png_unknown_chunk unknown, int *unc_size) { unsigned int i; @@ -27778,7 +27778,7 @@ Bytef *get_chunk_data(FILE * fp, char *fname, png_structp png_ptr, /** * FIXME */ -void load_embedded_data(char *fname, SDL_Surface * org_surf) +void load_embedded_data(char *fname, SDL_Surface *org_surf) { FILE *fi, *fp; char *control; @@ -29502,7 +29502,7 @@ static void do_lock_file(void) } int TP_EventFilter( __attribute__((unused)) - void *data, EVENT_FILTER_EVENT_TYPE * event) + void *data, EVENT_FILTER_EVENT_TYPE *event) /** * FIXME */ @@ -29526,8 +29526,7 @@ int TP_EventFilter( __attribute__((unused)) event->type == SDL_APP_WILLENTERBACKGROUND || event->type == SDL_APP_WILLENTERFOREGROUND || event->type == SDL_APP_DIDENTERBACKGROUND || - event->type == SDL_APP_DIDENTERFOREGROUND || - event->type == TP_USEREVENT_PLAYDESCSOUND) + event->type == SDL_APP_DIDENTERFOREGROUND || event->type == TP_USEREVENT_PLAYDESCSOUND) return 1; return 0; @@ -31295,7 +31294,7 @@ static void handle_joyaxismotion(SDL_Event event, int *motioner, int *val_x, int * FIXME */ static void handle_joyhatmotion(SDL_Event event, int oldpos_x, int oldpos_y, - int *valhat_x, int *valhat_y, int *hatmotioner, Uint32 * old_hat_ticks) + int *valhat_x, int *valhat_y, int *hatmotioner, Uint32 *old_hat_ticks) { *hatmotioner = 1; diff --git a/src/win32_dirent.c b/src/win32_dirent.c index daaae4b59..ecbece16f 100644 --- a/src/win32_dirent.c +++ b/src/win32_dirent.c @@ -66,7 +66,7 @@ DIR *opendir(const char *pSpec) * * @param pDir Opened directory to close. */ -void closedir(DIR * pDir) +void closedir(DIR *pDir) { assert(pDir != NULL); free(pDir); diff --git a/src/win32_print.c b/src/win32_print.c index b206d4899..effaaac01 100644 --- a/src/win32_print.c +++ b/src/win32_print.c @@ -40,7 +40,7 @@ static HDC hDCprinter = NULL; /** * FIXME */ -static SDL_Surface *make24bitDIB(SDL_Surface * surf) +static SDL_Surface *make24bitDIB(SDL_Surface *surf) { SDL_PixelFormat pixfmt; SDL_Surface *surf24; @@ -318,7 +318,7 @@ int IsPrinterAvailable(void) /** * FIXME */ -const char *SurfacePrint(SDL_Window * window, SDL_Surface * surf, const char *printcfg, int showdialog) +const char *SurfacePrint(SDL_Window *window, SDL_Surface *surf, const char *printcfg, int showdialog) { const char *res = NULL; HWND hWnd; diff --git a/src/win32_trash.c b/src/win32_trash.c index f1d16d3cd..f52e24c8a 100644 --- a/src/win32_trash.c +++ b/src/win32_trash.c @@ -4,7 +4,7 @@ int MoveFileToRecycleBin(const TCHAR * fullPathName); int win32_trash(const char *path); -int MoveFileToRecycleBin(const TCHAR * fullPathName) +int MoveFileToRecycleBin(const TCHAR *fullPathName) { SHFILEOPSTRUCT fileOp; const TCHAR *src = fullPathName;