Removing warnings on magic toothpaste and tv by finaiized as a task in GCI

This commit is contained in:
Pere Pujal i Carabantes 2011-12-17 22:43:56 +00:00
parent f08bcfe9cd
commit bda0f95b55
2 changed files with 85 additions and 35 deletions

View file

@ -68,6 +68,31 @@ const char * toothpaste_descs[toothpaste_NUM_TOOLS] = {
gettext_noop("Click and drag to squirt toothpaste onto your picture."), gettext_noop("Click and drag to squirt toothpaste onto your picture."),
}; };
Uint32 toothpaste_api_version(void);
int toothpaste_init(magic_api * api);
int toothpaste_get_tool_count(magic_api * api);
SDL_Surface * toothpaste_get_icon(magic_api * api, int which);
char * toothpaste_get_name(magic_api * api, int which);
char * toothpaste_get_description(magic_api * api, int which, int mode);
static void do_toothpaste(void * ptr, int which, SDL_Surface * canvas, SDL_Surface * last,
int x, int y);
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_click(magic_api * api, int which, int mode,
SDL_Surface * canvas, SDL_Surface * last,
int x, int y, SDL_Rect * update_rect);
void toothpaste_release(magic_api * api, int which,
SDL_Surface * canvas, SDL_Surface * last,
int x, int y, SDL_Rect * update_rect);
void toothpaste_shutdown(magic_api * api);
void toothpaste_set_color(magic_api * api, Uint8 r, Uint8 g, Uint8 b);
int toothpaste_requires_colors(magic_api * api, int which);
void toothpaste_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
void toothpaste_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
int toothpaste_modes(magic_api * api, int which);
Uint32 toothpaste_api_version(void) { return(TP_MAGIC_API_VERSION); } Uint32 toothpaste_api_version(void) { return(TP_MAGIC_API_VERSION); }
@ -100,34 +125,33 @@ int toothpaste_init(magic_api * api){
return(1); return(1);
} }
int toothpaste_get_tool_count(magic_api * api){ int toothpaste_get_tool_count(magic_api * api ATTRIBUTE_UNUSED){
return(toothpaste_NUM_TOOLS); return(toothpaste_NUM_TOOLS);
} }
// Load our icons: // Load our icons:
SDL_Surface * toothpaste_get_icon(magic_api * api, int which){ SDL_Surface * toothpaste_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED){
char fname[1024]; char fname[1024];
snprintf(fname, sizeof(fname), "%simages/magic/%s", api->data_directory, toothpaste_icon_filenames[which]); snprintf(fname, sizeof(fname), "%simages/magic/%s", api->data_directory, toothpaste_icon_filenames[which]);
return(IMG_Load(fname)); return(IMG_Load(fname));
} }
// Return our names, localized: // Return our names, localized:
char * toothpaste_get_name(magic_api * api, int which){ char * toothpaste_get_name(magic_api * api ATTRIBUTE_UNUSED, int which){
return(strdup(gettext_noop(toothpaste_names[which]))); return(strdup(gettext_noop(toothpaste_names[which])));
} }
// Return our descriptions, localized: // Return our descriptions, localized:
char * toothpaste_get_description(magic_api * api, int which, int mode){ char * toothpaste_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED){
return(strdup(gettext_noop(toothpaste_descs[which]))); return(strdup(gettext_noop(toothpaste_descs[which])));
} }
// Do the effect: // Do the effect:
static void do_toothpaste(void * ptr, int which, SDL_Surface * canvas, SDL_Surface * last, static void do_toothpaste(void * ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y){
int x, int y){
magic_api * api = (magic_api *) ptr; magic_api * api = (magic_api *) ptr;
int xx, yy; int xx, yy;
double colr; // double colr;
float h,s,v; float h,s,v;
Uint8 r,g,b; Uint8 r,g,b;
@ -163,7 +187,7 @@ void toothpaste_drag(magic_api * api, int which, SDL_Surface * canvas,
} }
// Affect the canvas on click: // Affect the canvas on click:
void toothpaste_click(magic_api * api, int which, int mode, void toothpaste_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED,
SDL_Surface * canvas, SDL_Surface * last, SDL_Surface * canvas, SDL_Surface * last,
int x, int y, SDL_Rect * update_rect){ int x, int y, SDL_Rect * update_rect){
@ -171,14 +195,14 @@ void toothpaste_click(magic_api * api, int which, int mode,
} }
// Affect the canvas on release: // Affect the canvas on release:
void toothpaste_release(magic_api * api, int which, void toothpaste_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
SDL_Surface * canvas, SDL_Surface * last, SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED,
int x, int y, SDL_Rect * update_rect) int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
{ {
} }
// No setup happened: // No setup happened:
void toothpaste_shutdown(magic_api * api) void toothpaste_shutdown(magic_api * api ATTRIBUTE_UNUSED)
{ {
//Clean up sounds //Clean up sounds
int i; int i;
@ -194,7 +218,7 @@ void toothpaste_shutdown(magic_api * api)
} }
// Record the color from Tux Paint: // Record the color from Tux Paint:
void toothpaste_set_color(magic_api * api, Uint8 r, Uint8 g, Uint8 b) void toothpaste_set_color(magic_api * api ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b)
{ {
toothpaste_r = r; toothpaste_r = r;
toothpaste_g = g; toothpaste_g = g;
@ -202,21 +226,21 @@ void toothpaste_set_color(magic_api * api, Uint8 r, Uint8 g, Uint8 b)
} }
// Use colors: // Use colors:
int toothpaste_requires_colors(magic_api * api, int which) int toothpaste_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{ {
return 1; return 1;
} }
void toothpaste_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas) 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, int which, int mode, SDL_Surface * canvas) 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, int which) int toothpaste_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{ {
return(MODE_PAINT); return(MODE_PAINT);
} }

View file

@ -34,6 +34,32 @@ int RADIUS = 16;
Mix_Chunk * tv_snd; Mix_Chunk * tv_snd;
Uint32 tv_api_version(void);
void tv_set_color(magic_api * api, Uint8 r, Uint8 g, Uint8 b);
int tv_init(magic_api * api);
int tv_get_tool_count(magic_api * api);
SDL_Surface * tv_get_icon(magic_api * api, int which);
char * tv_get_name(magic_api * api, int which);
char * tv_get_description(magic_api * api, int which, int mode);
int tv_requires_colors(magic_api * api, int which);
void tv_release(magic_api * api, int which,
SDL_Surface * canvas, SDL_Surface * snapshot,
int x, int y, SDL_Rect * update_rect);
void tv_shutdown(magic_api * api);
void tv_paint_tv(void * ptr_to_api, int which_tool,
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
void tv_do_tv(void * ptr_to_api, int which_tool,
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
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_click(magic_api * api, int which, int mode,
SDL_Surface * canvas, SDL_Surface * last,
int x, int y, SDL_Rect * update_rect);
void tv_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
void tv_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
int tv_modes(magic_api * api, int which);
// Housekeeping functions // Housekeeping functions
Uint32 tv_api_version(void) Uint32 tv_api_version(void)
@ -41,12 +67,12 @@ Uint32 tv_api_version(void)
return(TP_MAGIC_API_VERSION); return(TP_MAGIC_API_VERSION);
} }
void tv_set_color(magic_api * api, Uint8 r, Uint8 g, Uint8 b) //get the colors from API and store it in structure void tv_set_color(magic_api * api ATTRIBUTE_UNUSED, Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED) //get the colors from API and store it in structure
{ {
} }
int tv_init(magic_api * api) int tv_init(magic_api * api ATTRIBUTE_UNUSED)
{ {
char fname[1024]; char fname[1024];
@ -56,12 +82,12 @@ int tv_init(magic_api * api)
return(1); return(1);
} }
int tv_get_tool_count(magic_api * api) int tv_get_tool_count(magic_api * api ATTRIBUTE_UNUSED)
{ {
return 1; return 1;
} }
SDL_Surface * tv_get_icon(magic_api * api, int which) SDL_Surface * tv_get_icon(magic_api * api, int which ATTRIBUTE_UNUSED)
{ {
char fname[1024]; char fname[1024];
@ -71,9 +97,9 @@ SDL_Surface * tv_get_icon(magic_api * api, int which)
return(IMG_Load(fname)); return(IMG_Load(fname));
} }
char * tv_get_name(magic_api * api, int which) { return strdup(gettext_noop("TV")); } char * tv_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return strdup(gettext_noop("TV")); }
char * tv_get_description(magic_api * api, int which, int mode) char * tv_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode)
{ {
if (mode == MODE_PAINT) if (mode == MODE_PAINT)
return strdup(gettext_noop("Click and drag to make parts of your picture look like they are on television.")); return strdup(gettext_noop("Click and drag to make parts of your picture look like they are on television."));
@ -83,21 +109,21 @@ char * tv_get_description(magic_api * api, int which, int mode)
} }
int tv_requires_colors(magic_api * api, int which) { return 0; } int tv_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return 0; }
void tv_release(magic_api * api, int which, void tv_release(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
SDL_Surface * canvas, SDL_Surface * snapshot, SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * snapshot ATTRIBUTE_UNUSED,
int x, int y, SDL_Rect * update_rect) int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
{ {
} }
void tv_shutdown(magic_api * api) void tv_shutdown(magic_api * api ATTRIBUTE_UNUSED)
{ Mix_FreeChunk(tv_snd); } { Mix_FreeChunk(tv_snd); }
// Interactivity functions // Interactivity functions
void tv_paint_tv(void * ptr_to_api, int which_tool, void tv_paint_tv(void * ptr_to_api, int which_tool ATTRIBUTE_UNUSED,
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y) SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y)
{ {
int i, j; int i, j;
magic_api * api = (magic_api *) ptr_to_api; magic_api * api = (magic_api *) ptr_to_api;
@ -110,8 +136,8 @@ void tv_paint_tv(void * ptr_to_api, int which_tool,
api->putpixel(canvas, i, j, SDL_MapRGB(canvas->format, 128, 128, 165)); api->putpixel(canvas, i, j, SDL_MapRGB(canvas->format, 128, 128, 165));
} }
void tv_do_tv(void * ptr_to_api, int which_tool, void tv_do_tv(void * ptr_to_api, int which_tool ATTRIBUTE_UNUSED,
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y) SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED, int x, int y)
{ {
magic_api * api = (magic_api *) ptr_to_api; magic_api * api = (magic_api *) ptr_to_api;
@ -154,17 +180,17 @@ void tv_click(magic_api * api, int which, int mode,
} }
} }
void tv_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas) 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, int which, int mode, SDL_Surface * canvas) 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, int which) int tv_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{ {
return(MODE_FULLSCREEN | MODE_PAINT); return(MODE_FULLSCREEN | MODE_PAINT);
} }