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
|
|
@ -89,29 +89,25 @@ SDL_Surface *snow_get_icon(magic_api * api, int which);
|
|||
char *snow_get_name(magic_api * api, int which);
|
||||
int snow_get_group(magic_api * api, int which);
|
||||
char *snow_get_description(magic_api * api, int which);
|
||||
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);
|
||||
void snow_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 snow_click(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
|
||||
void snow_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 snow_shutdown(magic_api * api);
|
||||
void snow_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
int snow_requires_colors(magic_api * api, int which);
|
||||
void snow_switchin(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas);
|
||||
void snow_switchout(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas);
|
||||
void snow_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
void snow_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
int snow_modes(magic_api * api, int which);
|
||||
Uint8 snow_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 snow_default_size(magic_api * api, int which, int mode);
|
||||
void snow_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
void snow_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 snow_api_version(void)
|
||||
|
|
@ -128,16 +124,14 @@ int snow_init(magic_api * api, Uint32 disabled_features ATTRIBUTE_UNUSED)
|
|||
|
||||
srand(time(0));
|
||||
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/Snow_flake4.png",
|
||||
api->data_directory);
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/Snow_flake4.png", api->data_directory);
|
||||
snow_flake1 = IMG_Load(fname);
|
||||
if (snow_flake1 == NULL)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/Snow_flake5.png",
|
||||
api->data_directory);
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/Snow_flake5.png", api->data_directory);
|
||||
snow_flake2 = IMG_Load(fname);
|
||||
if (snow_flake2 == NULL)
|
||||
{
|
||||
|
|
@ -146,8 +140,7 @@ int snow_init(magic_api * api, Uint32 disabled_features ATTRIBUTE_UNUSED)
|
|||
|
||||
for (i = 0; i < snow_NUM_TOOLS; i++)
|
||||
{
|
||||
snprintf(fname, sizeof(fname), "%ssounds/magic/%s", api->data_directory,
|
||||
snow_snd_filenames[i]);
|
||||
snprintf(fname, sizeof(fname), "%ssounds/magic/%s", api->data_directory, snow_snd_filenames[i]);
|
||||
snow_snd_effect[i] = Mix_LoadWAV(fname);
|
||||
}
|
||||
return (1);
|
||||
|
|
@ -163,8 +156,7 @@ SDL_Surface *snow_get_icon(magic_api * api, int which)
|
|||
{
|
||||
char fname[1024];
|
||||
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/%s", api->data_directory,
|
||||
snow_icon_filenames[which]);
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/%s", api->data_directory, snow_icon_filenames[which]);
|
||||
return (IMG_Load(fname));
|
||||
}
|
||||
|
||||
|
|
@ -174,8 +166,7 @@ char *snow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which)
|
|||
return (strdup(gettext_noop(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 */
|
||||
}
|
||||
|
|
@ -187,8 +178,7 @@ char *snow_get_description(magic_api * api ATTRIBUTE_UNUSED, int 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;
|
||||
|
||||
|
|
@ -208,10 +198,8 @@ static void do_snow(void *ptr, SDL_Surface * canvas, SDL_Surface * last,
|
|||
{
|
||||
if (api->in_circle(x, y, snow_RADIUS))
|
||||
{
|
||||
SDL_GetRGB(api->getpixel(last, centre_x + x, centre_y + y),
|
||||
last->format, &r, &g, &b);
|
||||
api->putpixel(canvas, centre_x + x, centre_y + y,
|
||||
SDL_MapRGB(canvas->format, 255, 255, 255));
|
||||
SDL_GetRGB(api->getpixel(last, centre_x + x, centre_y + y), last->format, &r, &g, &b);
|
||||
api->putpixel(canvas, centre_x + x, centre_y + y, SDL_MapRGB(canvas->format, 255, 255, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -237,8 +225,7 @@ 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
|
||||
}
|
||||
|
|
@ -246,8 +233,7 @@ void snow_drag(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
|||
// 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)
|
||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect)
|
||||
{
|
||||
update_rect->x = 0;
|
||||
update_rect->y = 0;
|
||||
|
|
@ -263,8 +249,7 @@ 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)
|
||||
int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -293,26 +278,24 @@ 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)
|
||||
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)
|
||||
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 which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -333,6 +316,8 @@ Uint8 snow_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue