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
|
|
@ -49,26 +49,24 @@ int checkerboard_get_group(magic_api * api, int which);
|
|||
char *checkerboard_get_description(magic_api * api, int which, int mode);
|
||||
int checkerboard_requires_colors(magic_api * api, int which);
|
||||
void checkerboard_release(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x,
|
||||
int y, SDL_Rect * update_rect);
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void checkerboard_shutdown(magic_api * api);
|
||||
void checkerboard_paint_checkerboard(void *ptr_to_api, int which_tool,
|
||||
SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y);
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
|
||||
void checkerboard_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int ox, int oy, int x, int y,
|
||||
SDL_Rect * update_rect);
|
||||
SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect);
|
||||
void checkerboard_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, int x,
|
||||
int y, SDL_Rect * update_rect);
|
||||
void checkerboard_switchin(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas);
|
||||
void checkerboard_switchout(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas);
|
||||
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void checkerboard_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
void checkerboard_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
int checkerboard_modes(magic_api * api, int which);
|
||||
Uint8 checkerboard_accepted_sizes(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);
|
||||
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);
|
||||
Uint8 checkerboard_accepted_sizes(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);
|
||||
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);
|
||||
|
||||
// Housekeeping functions
|
||||
|
||||
|
|
@ -77,8 +75,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;
|
||||
|
|
@ -90,8 +89,7 @@ int checkerboard_init(magic_api * api, Uint32 disabled_features ATTRIBUTE_UNUSED
|
|||
{
|
||||
char fname[1024];
|
||||
|
||||
snprintf(fname, sizeof(fname), "%ssounds/magic/checkerboard.ogg",
|
||||
api->data_directory);
|
||||
snprintf(fname, sizeof(fname), "%ssounds/magic/checkerboard.ogg", api->data_directory);
|
||||
checkerboard_snd = Mix_LoadWAV(fname);
|
||||
|
||||
return (1);
|
||||
|
|
@ -102,40 +100,32 @@ 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];
|
||||
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/checkerboard.png",
|
||||
api->data_directory);
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/checkerboard.png", api->data_directory);
|
||||
|
||||
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_noop("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;
|
||||
}
|
||||
|
||||
char *checkerboard_get_description(magic_api * api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED)
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return
|
||||
strdup(gettext_noop
|
||||
("Click and drag to fill the canvas with a checkerboard pattern."));
|
||||
return strdup(gettext_noop("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;
|
||||
}
|
||||
|
|
@ -144,8 +134,7 @@ 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)
|
||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -158,8 +147,7 @@ void checkerboard_shutdown(magic_api * api ATTRIBUTE_UNUSED)
|
|||
|
||||
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 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;
|
||||
|
|
@ -168,13 +156,9 @@ void checkerboard_drag(magic_api * api, int which ATTRIBUTE_UNUSED,
|
|||
|
||||
SDL_BlitSurface(snapshot, NULL, canvas, NULL);
|
||||
|
||||
sz =
|
||||
max(10,
|
||||
max(abs(x - checkerboard_start_x), abs(y - checkerboard_start_y)));
|
||||
sz = max(10, max(abs(x - checkerboard_start_x), abs(y - checkerboard_start_y)));
|
||||
|
||||
colr =
|
||||
SDL_MapRGB(canvas->format, checkerboard_r, checkerboard_g,
|
||||
checkerboard_b);
|
||||
colr = SDL_MapRGB(canvas->format, checkerboard_r, checkerboard_g, checkerboard_b);
|
||||
|
||||
draw_start = 1;
|
||||
if (x < checkerboard_start_x)
|
||||
|
|
@ -267,8 +251,7 @@ void checkerboard_drag(magic_api * api, int which ATTRIBUTE_UNUSED,
|
|||
|
||||
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)
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
checkerboard_start_x = x;
|
||||
checkerboard_start_y = y;
|
||||
|
|
@ -276,26 +259,23 @@ void checkerboard_click(magic_api * api, int which ATTRIBUTE_UNUSED,
|
|||
}
|
||||
|
||||
void checkerboard_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 checkerboard_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)
|
||||
{
|
||||
}
|
||||
|
||||
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, int mode ATTRIBUTE_UNUSED)
|
||||
Uint8 checkerboard_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -305,6 +285,8 @@ Uint8 checkerboard_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTR
|
|||
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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue