Adding "indent.sh" to re-indent code; ran it!!!
This commit is contained in:
parent
16336cc854
commit
18f9cad6fe
98 changed files with 5798 additions and 9001 deletions
|
|
@ -58,8 +58,7 @@ char *pixels_get_name(magic_api * api, int which);
|
|||
int pixels_get_group(magic_api * api, int which);
|
||||
char *pixels_get_description(magic_api * api, int which, int mode);
|
||||
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);
|
||||
SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect);
|
||||
void pixels_click(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void pixels_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
|
|
@ -68,14 +67,13 @@ void pixels_shutdown(magic_api * api);
|
|||
void pixels_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
int pixels_requires_colors(magic_api * api, int which);
|
||||
void pixels_switchin(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas);
|
||||
void pixels_switchout(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas);
|
||||
void pixels_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
void pixels_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
int pixels_modes(magic_api * api, int which);
|
||||
Uint8 pixels_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 pixels_default_size(magic_api * api, int which, int mode);
|
||||
void pixels_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
void pixels_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
|
||||
|
||||
// No setup required:
|
||||
|
|
@ -83,8 +81,7 @@ int pixels_init(magic_api * api, Uint32 disabled_features ATTRIBUTE_UNUSED)
|
|||
{
|
||||
char fname[1024];
|
||||
|
||||
snprintf(fname, sizeof(fname), "%ssounds/magic/pixels.ogg",
|
||||
api->data_directory);
|
||||
snprintf(fname, sizeof(fname), "%ssounds/magic/pixels.ogg", api->data_directory);
|
||||
pixel_snd = Mix_LoadWAV(fname);
|
||||
|
||||
return (1);
|
||||
|
|
@ -106,30 +103,25 @@ SDL_Surface *pixels_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED)
|
|||
{
|
||||
char fname[1024];
|
||||
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/pixels.png",
|
||||
api->data_directory);
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/pixels.png", api->data_directory);
|
||||
|
||||
return (IMG_Load(fname));
|
||||
}
|
||||
|
||||
// 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_noop("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;
|
||||
}
|
||||
|
||||
// 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_noop("Click and drag to draw large pixels.")));
|
||||
|
||||
|
|
@ -139,8 +131,7 @@ char *pixels_get_description(magic_api * api ATTRIBUTE_UNUSED,
|
|||
// 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;
|
||||
|
||||
|
|
@ -149,16 +140,14 @@ static void do_pixels(void *ptr ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
|||
dest.w = pixel_size;
|
||||
dest.h = pixel_size;
|
||||
|
||||
SDL_FillRect(canvas, &dest,
|
||||
SDL_MapRGB(canvas->format, pixels_r, pixels_g, pixels_b));
|
||||
SDL_FillRect(canvas, &dest, SDL_MapRGB(canvas->format, pixels_r, pixels_g, pixels_b));
|
||||
}
|
||||
|
||||
// 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)
|
||||
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);
|
||||
api->line((void *)api, which, canvas, last, ox, oy, x, y, 1, do_pixels);
|
||||
|
||||
if (ox > x)
|
||||
{
|
||||
|
|
@ -190,8 +179,7 @@ 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)
|
||||
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);
|
||||
}
|
||||
|
|
@ -199,8 +187,7 @@ void pixels_click(magic_api * api, int which, int mode 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)
|
||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
api->stopsound();
|
||||
}
|
||||
|
|
@ -213,8 +200,9 @@ void pixels_shutdown(magic_api * api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// 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;
|
||||
|
|
@ -222,21 +210,18 @@ 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)
|
||||
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 which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +241,9 @@ Uint8 pixels_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue