indent shift.c

This commit is contained in:
Bill Kendrick 2017-10-15 11:50:00 -07:00
parent fee4c7ca44
commit e6a81956de

View file

@ -44,8 +44,7 @@ static Mix_Chunk * shift_snd;
/* Local function prototypes: */
static void shift_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);
SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect, int crosshairs);
Uint32 shift_api_version(void);
int shift_init(magic_api * api);
int shift_get_tool_count(magic_api * api);
@ -53,14 +52,11 @@ SDL_Surface * shift_get_icon(magic_api * api, int which);
char *shift_get_name(magic_api * api, int which);
char *shift_get_description(magic_api * api, int which, int mode);
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);
SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect);
void shift_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 shift_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 shift_shutdown(magic_api * api);
void shift_set_color(magic_api * api, Uint8 r, Uint8 g, Uint8 b);
int shift_requires_colors(magic_api * api, int which);
@ -71,7 +67,10 @@ int shift_modes(magic_api * api, int which);
Uint32 shift_api_version(void) { return(TP_MAGIC_API_VERSION); }
Uint32 shift_api_version(void)
{
return (TP_MAGIC_API_VERSION);
}
// No setup required:
@ -79,8 +78,7 @@ int shift_init(magic_api * api)
{
char fname[1024];
snprintf(fname, sizeof(fname), "%s/sounds/magic/shift.ogg",
api->data_directory);
snprintf(fname, sizeof(fname), "%s/sounds/magic/shift.ogg", api->data_directory);
shift_snd = Mix_LoadWAV(fname);
return (1);
@ -97,8 +95,7 @@ SDL_Surface * shift_get_icon(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU
{
char fname[1024];
snprintf(fname, sizeof(fname), "%s/images/magic/shift.png",
api->data_directory);
snprintf(fname, sizeof(fname), "%s/images/magic/shift.png", api->data_directory);
return (IMG_Load(fname));
}
@ -118,8 +115,7 @@ char * shift_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBU
// 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)
SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect)
{
if (ox == x && oy == y)
return; /* No-op */
@ -290,8 +286,7 @@ static void shift_doit(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
// 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)
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect)
{
shift_x = x;
shift_y = y;
@ -301,8 +296,7 @@ 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)
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();
@ -328,11 +322,13 @@ int shift_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
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)
{
}