Ran indent.sh to re-indent all source code
This commit is contained in:
parent
75fbc97e9f
commit
e80254df51
81 changed files with 1326 additions and 976 deletions
|
|
@ -434,9 +434,10 @@ void rivulet_switchin(magic_api *api ATTRIBUTE_UNUSED,
|
|||
zero_riv_arrays(canvas);
|
||||
|
||||
if (rivulet_snapshot == NULL)
|
||||
rivulet_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel, canvas->format->Rmask,
|
||||
canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
rivulet_snapshot =
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
if (rivulet_snapshot != NULL)
|
||||
SDL_BlitSurface(canvas, NULL, rivulet_snapshot, NULL);
|
||||
|
|
|
|||
|
|
@ -174,13 +174,13 @@ specular_release(magic_api *api, int which,
|
|||
{
|
||||
}
|
||||
|
||||
void specular_set_color(magic_api *api, int which, SDL_Surface *canvas, SDL_Surface *snapshot, Uint8 r, Uint8 g,
|
||||
Uint8 b, SDL_Rect *update_rect)
|
||||
void specular_set_color(magic_api *api, int which, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot, Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect)
|
||||
{
|
||||
}
|
||||
|
||||
void specular_set_size(magic_api *api, int which, int mode, SDL_Surface *canvas, SDL_Surface *snapshot, Uint8 size,
|
||||
SDL_Rect *update_rect)
|
||||
void specular_set_size(magic_api *api, int which, int mode,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot, Uint8 size, SDL_Rect *update_rect)
|
||||
{
|
||||
specular_size = size * 16;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ void warp_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
|||
int warp_modes(magic_api * api, int which);
|
||||
Uint8 warp_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 warp_default_size(magic_api * api, int which, int mode);
|
||||
void warp_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void warp_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 warp_api_version(void)
|
||||
|
|
@ -286,10 +286,12 @@ void warp_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
}
|
||||
|
||||
void warp_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)
|
||||
void warp_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -376,9 +378,10 @@ Uint8 warp_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
|
|||
return (NUM_WARP_SIZES / 2);
|
||||
}
|
||||
|
||||
void warp_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void warp_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
warp_radius = (size * MAX_WARP_RADIUS) / NUM_WARP_SIZES;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,10 +307,12 @@ void alien_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void alien_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)
|
||||
void alien_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -330,9 +332,10 @@ Uint8 alien_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 4;
|
||||
}
|
||||
|
||||
void alien_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void alien_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
alien_RADIUS = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@ void ascii_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
|||
int ascii_modes(magic_api * api, int which);
|
||||
Uint8 ascii_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 ascii_default_size(magic_api * api, int which, int mode);
|
||||
void ascii_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void ascii_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
void do_ascii_effect(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y);
|
||||
int get_best_char(int which, int brightness);
|
||||
int get_bright(magic_api * api, int r, int g, int b);
|
||||
|
|
@ -252,8 +252,8 @@ int ascii_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 c
|
|||
/* Calculate the intensity of each character */
|
||||
area = ascii_char_maxwidth[i] * ascii_bitmap[i]->h;
|
||||
|
||||
DEBUG_PRINTF("%s max char width is %d -- * %d = area %d\n", fname, ascii_char_maxwidth[i], ascii_bitmap[i]->h,
|
||||
area);
|
||||
DEBUG_PRINTF("%s max char width is %d -- * %d = area %d\n", fname,
|
||||
ascii_char_maxwidth[i], ascii_bitmap[i]->h, area);
|
||||
|
||||
for (j = 0; j < num_chars; j++)
|
||||
{
|
||||
|
|
@ -341,11 +341,14 @@ char *ascii_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mode
|
|||
char tmp[1024];
|
||||
|
||||
if (mode == MODE_PAINT)
|
||||
snprintf(tmp, sizeof(tmp), gettext("Click and drag to transform parts of your drawing to ASCII art (%s style)."),
|
||||
snprintf(tmp, sizeof(tmp),
|
||||
gettext
|
||||
("Click and drag to transform parts of your drawing to ASCII art (%s style)."),
|
||||
gettext(ascii_tool_names[which]));
|
||||
else
|
||||
snprintf(tmp, sizeof(tmp), gettext("Click to transform your entire drawing to ASCII art (%s style)."),
|
||||
gettext(ascii_tool_names[which]));
|
||||
snprintf(tmp, sizeof(tmp),
|
||||
gettext
|
||||
("Click to transform your entire drawing to ASCII art (%s style)."), gettext(ascii_tool_names[which]));
|
||||
|
||||
return (strdup(tmp));
|
||||
}
|
||||
|
|
@ -398,7 +401,8 @@ void ascii_click(magic_api *api, int which, int mode,
|
|||
}
|
||||
}
|
||||
|
||||
void ascii_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void ascii_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)
|
||||
|
|
@ -425,9 +429,11 @@ void ascii_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
}
|
||||
|
||||
void ascii_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 ascii_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)
|
||||
{
|
||||
/* If the bitmap's "clear" color, choose the opposite! */
|
||||
if (abs(r - ascii_clear_r[which]) < 8 && abs(g - ascii_clear_g[which]) < 8 && abs(b - ascii_clear_b[which]) < 8)
|
||||
|
|
@ -455,7 +461,8 @@ void ascii_switchin(magic_api *api ATTRIBUTE_UNUSED,
|
|||
{
|
||||
if (ascii_snapshot == NULL)
|
||||
ascii_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel, canvas->format->Rmask,
|
||||
canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask,
|
||||
canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
if (ascii_snapshot != NULL)
|
||||
|
|
@ -495,9 +502,10 @@ Uint8 ascii_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 0;
|
||||
}
|
||||
|
||||
void ascii_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void ascii_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ascii_size = size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,8 +78,8 @@ void blind_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
|||
int blind_modes(magic_api * api, int which);
|
||||
Uint8 blind_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 blind_default_size(magic_api * api, int which, int mode);
|
||||
void blind_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void blind_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
// Housekeeping functions
|
||||
|
||||
|
|
@ -88,8 +88,10 @@ Uint32 blind_api_version(void)
|
|||
return (TP_MAGIC_API_VERSION);
|
||||
}
|
||||
|
||||
void blind_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,
|
||||
void blind_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
|
||||
|
|
@ -344,8 +346,10 @@ Uint8 blind_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 0;
|
||||
}
|
||||
|
||||
void blind_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,
|
||||
void blind_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ void blocks_etc_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 blocks_etc_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void blocks_etc_release(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void blocks_etc_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void blocks_etc_shutdown(magic_api * api);
|
||||
void blocks_etc_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
|
|
@ -76,8 +76,8 @@ void blocks_etc_switchout(magic_api * api, int which, int mode, SDL_Surface * ca
|
|||
int blocks_etc_modes(magic_api * api, int which);
|
||||
Uint8 blocks_etc_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 blocks_etc_default_size(magic_api * api, int which, int mode);
|
||||
void blocks_etc_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void blocks_etc_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -419,10 +419,12 @@ void blocks_etc_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void blocks_etc_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)
|
||||
void blocks_etc_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -461,9 +463,10 @@ Uint8 blocks_etc_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBU
|
|||
return 2;
|
||||
}
|
||||
|
||||
void blocks_etc_set_size(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void blocks_etc_set_size(magic_api *api ATTRIBUTE_UNUSED, int which,
|
||||
int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (which == TOOL_BLOCKS)
|
||||
EFFECT_REZ = size * 4;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ static int BLOOM_SPIKE_LENGTH = 5;
|
|||
* so they all SUM() to approx. 1.0000 */
|
||||
#define NUM_SAMPLE_WEIGHTS 13
|
||||
float sample_weights[NUM_SAMPLE_WEIGHTS] = {
|
||||
0.0449, 0.0627, 0.0752, 0.0842, 0.0904, 0.0940, 0.0952, 0.0940, 0.0904, 0.0842, 0.0752, 0.0627, 0.0449
|
||||
0.0449, 0.0627, 0.0752, 0.0842, 0.0904, 0.0940, 0.0952, 0.0940, 0.0904,
|
||||
0.0842, 0.0752, 0.0627, 0.0449
|
||||
};
|
||||
|
||||
Mix_Chunk *snd_effects = NULL;
|
||||
|
|
@ -68,8 +69,8 @@ float luminance(float r, float g, float b);
|
|||
float change_luminance(float c_in, float l_in, float l_out);
|
||||
Uint8 bloom_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 bloom_default_size(magic_api * api, int which, int mode);
|
||||
void bloom_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void bloom_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 bloom_api_version(void)
|
||||
|
|
@ -189,8 +190,8 @@ bloom_click(magic_api *api, int which, int mode,
|
|||
|
||||
|
||||
void
|
||||
bloom_drag(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect)
|
||||
bloom_drag(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot, int ox, int oy, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
if (bloom_mask == NULL)
|
||||
return;
|
||||
|
|
@ -323,11 +324,12 @@ void bloom_apply_effect(magic_api *api, SDL_Surface *canvas, SDL_Surface *snapsh
|
|||
}
|
||||
|
||||
|
||||
void bloom_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED,
|
||||
void bloom_set_color(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED 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)
|
||||
Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED,
|
||||
Uint8 b ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
/* TODO: Maybe some day? */
|
||||
}
|
||||
|
|
@ -414,9 +416,10 @@ Uint8 bloom_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 2;
|
||||
}
|
||||
|
||||
void bloom_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void bloom_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
BLOOM_PAINT_RADIUS = size * 12;
|
||||
BLOOM_SPIKE_LENGTH = sqrt(BLOOM_PAINT_RADIUS + 1);
|
||||
|
|
|
|||
|
|
@ -306,16 +306,20 @@ void blur_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void blur_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,
|
||||
void blur_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)
|
||||
{
|
||||
}
|
||||
|
||||
// Record the size from Tux Paint:
|
||||
void blur_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 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void blur_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 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
blur_RADIUS = sz * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,8 +78,8 @@ void bricks_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
int bricks_modes(magic_api * api, int which);
|
||||
Uint8 bricks_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 bricks_default_size(magic_api * api, int which, int mode);
|
||||
void bricks_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void bricks_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
// No setup required:
|
||||
int bricks_init(magic_api *api, Uint8 disabled_features, Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||
|
|
@ -308,8 +308,10 @@ void bricks_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void bricks_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,
|
||||
void bricks_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)
|
||||
{
|
||||
bricks_r = r;
|
||||
|
|
@ -378,9 +380,10 @@ Uint8 bricks_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 2;
|
||||
}
|
||||
|
||||
void bricks_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void bricks_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (size == 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ void calligraphy_switchout(magic_api * api, int which, int mode, SDL_Surface * c
|
|||
int calligraphy_modes(magic_api * api, int which);
|
||||
Uint8 calligraphy_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 calligraphy_default_size(magic_api * api, int which, int mode);
|
||||
void calligraphy_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void calligraphy_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -316,9 +316,10 @@ void calligraphy_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// We don't use colors
|
||||
void calligraphy_set_color(magic_api *api, 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 calligraphy_set_color(magic_api *api, 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)
|
||||
{
|
||||
int x, y;
|
||||
Uint8 a;
|
||||
|
|
@ -468,9 +469,11 @@ Uint8 calligraphy_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIB
|
|||
return 2;
|
||||
}
|
||||
|
||||
void calligraphy_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void calligraphy_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
callig_size = size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ void cartoon_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int cartoon_modes(magic_api * api, int which);
|
||||
Uint8 cartoon_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 cartoon_default_size(magic_api * api, int which, int mode);
|
||||
void cartoon_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void cartoon_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
// No setup required:
|
||||
|
|
@ -299,10 +299,12 @@ void cartoon_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void cartoon_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)
|
||||
void cartoon_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -352,9 +354,10 @@ Uint8 cartoon_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 4;
|
||||
}
|
||||
|
||||
void cartoon_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void cartoon_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
cartoon_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,12 +61,15 @@ void checkerboard_click(magic_api * api, int which, int mode,
|
|||
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 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
|
||||
|
|
@ -76,8 +79,10 @@ 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,
|
||||
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
|
||||
|
|
@ -279,8 +284,8 @@ int checkerboard_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS
|
|||
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;
|
||||
}
|
||||
|
|
@ -290,8 +295,11 @@ Uint8 checkerboard_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRI
|
|||
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,
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ void clone_crosshairs(magic_api * api, SDL_Surface * canvas, int x, int y);
|
|||
void done_cloning(magic_api * api, SDL_Surface * canvas, SDL_Rect * update_rect);
|
||||
Uint8 clone_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 clone_default_size(magic_api * api, int which, int mode);
|
||||
void clone_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void clone_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
// No setup required:
|
||||
int clone_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level)
|
||||
|
|
@ -357,10 +357,12 @@ void clone_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(clone_start_snd);
|
||||
}
|
||||
|
||||
void clone_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)
|
||||
void clone_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -406,9 +408,10 @@ Uint8 clone_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 2;
|
||||
}
|
||||
|
||||
void clone_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void clone_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
clone_radius = size * 8;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,8 +98,10 @@ void colorsep_switchin(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
void colorsep_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
Uint8 colorsep_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED);
|
||||
Uint8 colorsep_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED);
|
||||
void colorsep_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,
|
||||
void colorsep_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);
|
||||
|
||||
|
||||
|
|
@ -206,8 +208,8 @@ colorsep_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED,
|
|||
|
||||
void
|
||||
colorsep_drag(magic_api *api, int which, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED,
|
||||
int x, int y, SDL_Rect *update_rect)
|
||||
SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED,
|
||||
int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
int offset_x, offset_y;
|
||||
|
||||
|
|
@ -375,10 +377,11 @@ void colorsep_release(magic_api *api, int which,
|
|||
}
|
||||
|
||||
|
||||
void colorsep_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void colorsep_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)
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g,
|
||||
Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
colorsep_r_pct = (float)r / 255.0;
|
||||
colorsep_g_pct = (float)g / 255.0;
|
||||
|
|
@ -425,9 +428,10 @@ Uint8 colorsep_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
}
|
||||
|
||||
|
||||
void colorsep_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void colorsep_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
colorsep_3dglass_variation = (size - 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ void comicdot_switchout(magic_api * api, int which, int mode, SDL_Surface * canv
|
|||
int comicdot_modes(magic_api * api, int which);
|
||||
Uint8 comicdot_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 comicdot_default_size(magic_api * api, int which, int mode);
|
||||
void comicdot_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void comicdot_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
Uint32 comicdot_api_version(void)
|
||||
{
|
||||
|
|
@ -256,10 +256,11 @@ void comicdot_click(magic_api *api, int which, int mode,
|
|||
}
|
||||
}
|
||||
|
||||
void comicdot_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void comicdot_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)
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED,
|
||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
api->pausesound();
|
||||
}
|
||||
|
|
@ -281,8 +282,10 @@ void comicdot_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
}
|
||||
|
||||
void comicdot_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,
|
||||
void comicdot_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)
|
||||
{
|
||||
comicdot_r = r;
|
||||
|
|
@ -325,8 +328,10 @@ Uint8 comicdot_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
return 4;
|
||||
}
|
||||
|
||||
void comicdot_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,
|
||||
void comicdot_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)
|
||||
{
|
||||
comicdot_radius = size * 4;
|
||||
|
|
|
|||
|
|
@ -55,16 +55,18 @@ void confetti_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect);
|
||||
Uint8 confetti_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 confetti_default_size(magic_api * api, int which, int mode);
|
||||
void confetti_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void confetti_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
Uint32 confetti_api_version(void)
|
||||
{
|
||||
return (TP_MAGIC_API_VERSION);
|
||||
}
|
||||
|
||||
void confetti_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,
|
||||
void confetti_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
|
||||
|
|
@ -277,8 +279,10 @@ Uint8 confetti_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
return 2;
|
||||
}
|
||||
|
||||
void confetti_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,
|
||||
void confetti_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)
|
||||
{
|
||||
CONFETTI_BRUSH_SIZE = size * 4;
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ void crescent_switchout(magic_api * api, int which, int mode, SDL_Surface * canv
|
|||
int crescent_modes(magic_api * api, int which);
|
||||
Uint8 crescent_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 crescent_default_size(magic_api * api, int which, int mode);
|
||||
void crescent_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void crescent_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
void do_crescent(magic_api * api, SDL_Surface * canvas, int x, int y, SDL_Rect * update_rect, int final);
|
||||
|
||||
|
|
@ -194,9 +194,9 @@ void do_crescent(magic_api *api, SDL_Surface *canvas, int x, int y, SDL_Rect *up
|
|||
update_rect->h = canvas->h;
|
||||
}
|
||||
|
||||
void crescent_drag(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED,
|
||||
int x, int y, SDL_Rect *update_rect)
|
||||
void crescent_drag(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *last,
|
||||
int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
SDL_BlitSurface(last, NULL, canvas, NULL); // FIXME
|
||||
|
||||
|
|
@ -205,8 +205,9 @@ void crescent_drag(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canv
|
|||
api->playsound(crescent_snd, (x * 255) / canvas->w, 255);
|
||||
}
|
||||
|
||||
void crescent_click(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
void crescent_click(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
crescent_cx = x;
|
||||
crescent_cy = y;
|
||||
|
|
@ -216,8 +217,9 @@ void crescent_click(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBU
|
|||
api->playsound(crescent_snd, (x * 255) / canvas->w, 255);
|
||||
}
|
||||
|
||||
void crescent_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
void crescent_release(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
do_crescent(api, canvas, x, y, update_rect, 1);
|
||||
}
|
||||
|
|
@ -228,7 +230,8 @@ void crescent_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(crescent_snd);
|
||||
}
|
||||
|
||||
void crescent_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
void crescent_set_color(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g,
|
||||
Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
|
@ -266,8 +269,10 @@ Uint8 crescent_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
return DEFAULT_SIZE;
|
||||
}
|
||||
|
||||
void crescent_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,
|
||||
void crescent_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)
|
||||
{
|
||||
crescent_neg_size = size;
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ static void distortion_line_callback(void *ptr, int which, SDL_Surface * canvas,
|
|||
|
||||
Uint8 distortion_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 distortion_default_size(magic_api * api, int which, int mode);
|
||||
void distortion_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void distortion_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
/* Setup Functions: */
|
||||
|
|
@ -240,10 +240,12 @@ void distortion_release(magic_api *api ATTRIBUTE_UNUSED,
|
|||
}
|
||||
|
||||
|
||||
void distortion_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)
|
||||
void distortion_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -299,9 +301,11 @@ Uint8 distortion_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBU
|
|||
return 2;
|
||||
}
|
||||
|
||||
void distortion_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void distortion_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
distortion_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,12 +89,12 @@ void dither_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
|||
void dither_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
void dither_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, Uint8 size, SDL_Rect * update_rect);
|
||||
void dither_set_color(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
void dither_release(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void dither_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void dither_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
void dither_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void dither_click(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void dither_shutdown(magic_api * api);
|
||||
Uint8 dither_default_size(magic_api * api, int which, int mode);
|
||||
Uint8 dither_accepted_sizes(magic_api * api, int which, int mode);
|
||||
|
|
@ -384,9 +384,10 @@ void dither_release(magic_api *api, int which,
|
|||
}
|
||||
}
|
||||
|
||||
void dither_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void dither_set_color(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, Uint8 r,
|
||||
Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (r <= 240 || g <= 240 || b <= 240)
|
||||
{
|
||||
|
|
@ -399,9 +400,10 @@ void dither_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE
|
|||
}
|
||||
}
|
||||
|
||||
void dither_set_size(magic_api *api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void dither_set_size(magic_api *api ATTRIBUTE_UNUSED, int which,
|
||||
int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
dither_sizes[which] = size * DITHER_SIZE_SCALE;
|
||||
}
|
||||
|
|
@ -445,8 +447,8 @@ void dither_line_callback(void *pointer, int which, SDL_Surface *canvas, SDL_Sur
|
|||
}
|
||||
|
||||
|
||||
void dither_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas)
|
||||
void dither_switchin(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas)
|
||||
{
|
||||
if (dither_touched == NULL)
|
||||
{
|
||||
|
|
@ -461,7 +463,7 @@ void dither_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED
|
|||
dither_black = SDL_MapRGB(canvas->format, 0, 0, 0);
|
||||
}
|
||||
|
||||
void dither_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED)
|
||||
void dither_switchout(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ void emboss_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
int emboss_modes(magic_api * api, int which);
|
||||
Uint8 emboss_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 emboss_default_size(magic_api * api, int which, int mode);
|
||||
void emboss_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void emboss_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 emboss_api_version(void)
|
||||
|
|
@ -259,10 +259,12 @@ void emboss_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void emboss_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)
|
||||
void emboss_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -301,9 +303,10 @@ Uint8 emboss_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 4;
|
||||
}
|
||||
|
||||
void emboss_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void emboss_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
emboss_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@
|
|||
|
||||
#define EMITTER_DRAW_THRESHOLD 16
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
EMITTER_HEARTS,
|
||||
EMITTER_SPARKLES,
|
||||
EMITTER_STARS,
|
||||
|
|
@ -47,14 +48,14 @@ enum {
|
|||
};
|
||||
|
||||
/* Names of the tools (for button labels) */
|
||||
char * emitter_names[NUM_EMITTERS] = {
|
||||
char *emitter_names[NUM_EMITTERS] = {
|
||||
gettext_noop("Hearts"),
|
||||
gettext_noop("Sparkles"),
|
||||
gettext_noop("Stars"),
|
||||
};
|
||||
|
||||
/* For the "Draw a trail of %s ..." descriptions */
|
||||
char * emitter_descs[NUM_EMITTERS] = {
|
||||
char *emitter_descs[NUM_EMITTERS] = {
|
||||
gettext_noop("hearts"),
|
||||
gettext_noop("sparkles"),
|
||||
gettext_noop("stars"),
|
||||
|
|
@ -107,7 +108,7 @@ int emitter_max_trail_length;
|
|||
int emitter_cur_trail_length;
|
||||
int emitter_queue_x[EMITTER_QUEUE_SIZE], emitter_queue_y[EMITTER_QUEUE_SIZE];
|
||||
int emitter_queue_xm[EMITTER_QUEUE_SIZE], emitter_queue_ym[EMITTER_QUEUE_SIZE];
|
||||
SDL_Surface * * emitter_images[NUM_EMITTERS][EMITTER_QUEUE_SIZE];
|
||||
SDL_Surface **emitter_images[NUM_EMITTERS][EMITTER_QUEUE_SIZE];
|
||||
|
||||
/* Function prototypes: */
|
||||
|
||||
|
|
@ -120,22 +121,22 @@ int emitter_get_group(magic_api * api, int which);
|
|||
int emitter_get_order(int which);
|
||||
char *emitter_get_description(magic_api * api, int which, int mode);
|
||||
void emitter_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 emitter_click(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void emitter_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void emitter_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void emitter_shutdown(magic_api * api);
|
||||
void emitter_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
int emitter_requires_colors(magic_api * api, int which);
|
||||
void emitter_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
void emitter_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
int emitter_modes(magic_api * api, int which);
|
||||
Uint8 emitter_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 emitter_default_size(magic_api * api, int which, int mode);
|
||||
void emitter_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void emitter_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 emitter_api_version(void)
|
||||
|
|
@ -149,7 +150,7 @@ int emitter_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8
|
|||
{
|
||||
int i, j, k;
|
||||
char fname[1024];
|
||||
SDL_Surface * surf;
|
||||
SDL_Surface *surf;
|
||||
SDL_Rect src;
|
||||
Uint32 amask;
|
||||
|
||||
|
|
@ -161,11 +162,11 @@ int emitter_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8
|
|||
|
||||
for (i = 0; i < NUM_EMITTERS; i++)
|
||||
{
|
||||
emitter_images[i][0] = (SDL_Surface * *) malloc(sizeof(SDL_Surface *) * emitter_frames[i]);
|
||||
emitter_images[i][0] = (SDL_Surface * *)malloc(sizeof(SDL_Surface *) * emitter_frames[i]);
|
||||
if (emitter_images[i][0] == NULL)
|
||||
{
|
||||
fprintf(stderr, "Cannot allocate %s (%d) emitter's surface #0\n", emitter_names[i], i);
|
||||
return(0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
snprintf(fname, sizeof(fname), "%simages/magic/emitter%d.png", api->data_directory, i);
|
||||
|
|
@ -173,7 +174,7 @@ int emitter_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8
|
|||
if (surf == NULL)
|
||||
{
|
||||
fprintf(stderr, "Cannot load %s (%d) emitter's image: '%s'\n", emitter_names[i], i, fname);
|
||||
return(0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (emitter_frames[i] == 1)
|
||||
|
|
@ -191,10 +192,7 @@ int emitter_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8
|
|||
surf->w / emitter_frames[i],
|
||||
surf->h,
|
||||
surf->format->BitsPerPixel,
|
||||
surf->format->Rmask,
|
||||
surf->format->Gmask,
|
||||
surf->format->Bmask,
|
||||
amask);
|
||||
surf->format->Rmask, surf->format->Gmask, surf->format->Bmask, amask);
|
||||
|
||||
src.x = (surf->w / emitter_frames[i]) * j;
|
||||
src.y = 0;
|
||||
|
|
@ -211,26 +209,28 @@ int emitter_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8
|
|||
int w, h;
|
||||
float w_scale, h_scale;
|
||||
|
||||
emitter_images[i][j] = (SDL_Surface * *) malloc(sizeof(SDL_Surface *) * emitter_frames[i]);
|
||||
emitter_images[i][j] = (SDL_Surface * *)malloc(sizeof(SDL_Surface *) * emitter_frames[i]);
|
||||
if (emitter_images[i][j] == NULL)
|
||||
{
|
||||
fprintf(stderr, "Cannot allocate %s (%d) emitter's surface #%d\n", emitter_names[i], i, j);
|
||||
return(0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
for (k = 0; k < emitter_frames[i]; k++)
|
||||
{
|
||||
w = emitter_images[i][0][k]->w - (emitter_images[i][0][k]->w * j / EMITTER_QUEUE_SIZE);
|
||||
h = emitter_images[i][0][k]->h - (emitter_images[i][0][k]->h * j / EMITTER_QUEUE_SIZE);
|
||||
w_scale = (float) w / (float) emitter_images[i][0][k]->w;
|
||||
h_scale = (float) h / (float) emitter_images[i][0][k]->h;
|
||||
w_scale = (float)w / (float)emitter_images[i][0][k]->w;
|
||||
h_scale = (float)h / (float)emitter_images[i][0][k]->h;
|
||||
|
||||
emitter_images[i][j][k] = zoomSurface(emitter_images[i][0][k], w_scale, h_scale, 1 /* smooth */);
|
||||
emitter_images[i][j][k] = zoomSurface(emitter_images[i][0][k], w_scale, h_scale, 1 /* smooth */ );
|
||||
|
||||
if (emitter_images[i][j][k] == NULL)
|
||||
{
|
||||
fprintf(stderr, "Cannot scale %s (%d) emitter's image ('%s') (frame %d) to %d's size: %d x %d\n", emitter_names[i], i, fname, k, j, w, h);
|
||||
return(0);
|
||||
fprintf(stderr,
|
||||
"Cannot scale %s (%d) emitter's image ('%s') (frame %d) to %d's size: %d x %d\n",
|
||||
emitter_names[i], i, fname, k, j, w, h);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -276,15 +276,16 @@ char *emitter_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mo
|
|||
{
|
||||
char desc[1024];
|
||||
|
||||
snprintf(desc, sizeof(desc), gettext("Click and drag to draw a trail of %s on your picture."), gettext(emitter_descs[which]));
|
||||
snprintf(desc, sizeof(desc),
|
||||
gettext("Click and drag to draw a trail of %s on your picture."), gettext(emitter_descs[which]));
|
||||
return (strdup(desc));
|
||||
}
|
||||
|
||||
void emitter_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)
|
||||
{
|
||||
int i, img;
|
||||
SDL_Surface * tmpSurf, * srcSurf;
|
||||
SDL_Surface *tmpSurf, *srcSurf;
|
||||
SDL_Rect dest;
|
||||
|
||||
SDL_BlitSurface(last, NULL, canvas, NULL);
|
||||
|
|
@ -362,9 +363,11 @@ void emitter_drag(magic_api *api, int which, SDL_Surface *canvas,
|
|||
|
||||
if (emitter_rotate[which] != 0)
|
||||
{
|
||||
tmpSurf = rotozoomSurface(srcSurf, (rand() % emitter_rotate[which] * 2) - emitter_rotate[which], 1.0 /* no scale */, 1 /* smoothing */);
|
||||
tmpSurf =
|
||||
rotozoomSurface(srcSurf, (rand() % emitter_rotate[which] * 2) - emitter_rotate[which], 1.0 /* no scale */ ,
|
||||
1 /* smoothing */ );
|
||||
if (tmpSurf == NULL)
|
||||
return; // Abort!
|
||||
return; // Abort!
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -375,7 +378,7 @@ void emitter_drag(magic_api *api, int which, SDL_Surface *canvas,
|
|||
{
|
||||
int xx, yy;
|
||||
Uint32 amask;
|
||||
SDL_Surface * tmpSurf2;
|
||||
SDL_Surface *tmpSurf2;
|
||||
Uint8 r, g, b, a;
|
||||
|
||||
dest.x = emitter_queue_x[i] - tmpSurf->w / 2;
|
||||
|
|
@ -393,10 +396,7 @@ void emitter_drag(magic_api *api, int which, SDL_Surface *canvas,
|
|||
tmpSurf->w,
|
||||
tmpSurf->h,
|
||||
tmpSurf->format->BitsPerPixel,
|
||||
tmpSurf->format->Rmask,
|
||||
tmpSurf->format->Gmask,
|
||||
tmpSurf->format->Bmask,
|
||||
amask);
|
||||
tmpSurf->format->Rmask, tmpSurf->format->Gmask, tmpSurf->format->Bmask, amask);
|
||||
|
||||
if (tmpSurf2 != NULL)
|
||||
{
|
||||
|
|
@ -409,7 +409,8 @@ void emitter_drag(magic_api *api, int which, SDL_Surface *canvas,
|
|||
{
|
||||
SDL_GetRGBA(api->getpixel(tmpSurf, x, y), tmpSurf->format, &r, &g, &b, &a);
|
||||
api->putpixel(tmpSurf2, x, y,
|
||||
SDL_MapRGBA(tmpSurf2->format, (r + emitter_r) >> 1, (g + emitter_g) >> 1, (b + emitter_b) >> 1, a));
|
||||
SDL_MapRGBA(tmpSurf2->format, (r + emitter_r) >> 1,
|
||||
(g + emitter_g) >> 1, (b + emitter_b) >> 1, a));
|
||||
}
|
||||
}
|
||||
SDL_UnlockSurface(tmpSurf2);
|
||||
|
|
@ -435,7 +436,7 @@ void emitter_drag(magic_api *api, int which, SDL_Surface *canvas,
|
|||
}
|
||||
|
||||
void emitter_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)
|
||||
{
|
||||
emitter_queue_x[0] = x;
|
||||
emitter_queue_y[0] = y;
|
||||
|
|
@ -449,8 +450,8 @@ void emitter_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED,
|
|||
}
|
||||
|
||||
void emitter_release(magic_api *api, int which,
|
||||
SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED,
|
||||
int x, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED,
|
||||
int x, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -462,9 +463,10 @@ void emitter_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(emitter_snds[i]);
|
||||
}
|
||||
|
||||
void emitter_set_color(magic_api *api, 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 emitter_set_color(magic_api *api, 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)
|
||||
{
|
||||
emitter_r = r;
|
||||
emitter_g = g;
|
||||
|
|
@ -477,12 +479,12 @@ int emitter_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
}
|
||||
|
||||
void emitter_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 emitter_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -502,9 +504,10 @@ Uint8 emitter_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return (EMITTER_QUEUE_SIZE / EMITTER_QUEUE_SIZE_SCALE) / 2;
|
||||
}
|
||||
|
||||
void emitter_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void emitter_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
emitter_max_trail_length = size * EMITTER_QUEUE_SIZE_SCALE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,8 +141,8 @@ void fade_darken_switchout(magic_api * api, int which, int mode, SDL_Surface * c
|
|||
int fade_darken_modes(magic_api * api, int which);
|
||||
Uint8 fade_darken_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 fade_darken_default_size(magic_api * api, int which, int mode);
|
||||
void fade_darken_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void fade_darken_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
int fade_darken_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||
|
|
@ -366,9 +366,10 @@ void fade_darken_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(snd_effects[1]);
|
||||
}
|
||||
|
||||
void fade_darken_set_color(magic_api *api, 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 fade_darken_set_color(magic_api *api, 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)
|
||||
{
|
||||
float tmp;
|
||||
|
||||
|
|
@ -413,9 +414,11 @@ Uint8 fade_darken_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIB
|
|||
return 4;
|
||||
}
|
||||
|
||||
void fade_darken_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void fade_darken_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fade_darken_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ void fisheye_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int fisheye_modes(magic_api * api, int which);
|
||||
Uint8 fisheye_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 fisheye_default_size(magic_api * api, int which, int mode);
|
||||
void fisheye_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void fisheye_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
// Housekeeping functions
|
||||
|
|
@ -76,10 +76,12 @@ Uint32 fisheye_api_version(void)
|
|||
return (TP_MAGIC_API_VERSION);
|
||||
}
|
||||
|
||||
void fisheye_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)
|
||||
void fisheye_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -164,12 +166,14 @@ void fisheye_draw(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
|||
last_y = y;
|
||||
|
||||
oryg =
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, fisheye_radius, fisheye_radius, canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, fisheye_radius, fisheye_radius,
|
||||
canvas->format->BitsPerPixel, canvas->format->Rmask,
|
||||
canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
output =
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, fisheye_radius, fisheye_radius, canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, fisheye_radius, fisheye_radius,
|
||||
canvas->format->BitsPerPixel, canvas->format->Rmask,
|
||||
canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
rect.x = x - (fisheye_radius / 2);
|
||||
rect.y = y - (fisheye_radius / 2);
|
||||
|
|
@ -181,7 +185,8 @@ void fisheye_draw(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
|||
for (i = 0; i < fisheye_radius / 2; i++)
|
||||
{
|
||||
temp_src =
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, 1, fisheye_radius, canvas->format->BitsPerPixel,
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, 1, fisheye_radius,
|
||||
canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
//let's take a smooth bar of scaled bitmap and copy it to temp
|
||||
|
|
@ -221,7 +226,8 @@ void fisheye_draw(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
|||
for (i = 0; i < fisheye_radius / 2; i++)
|
||||
{
|
||||
temp_src =
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, fisheye_radius, 1, canvas->format->BitsPerPixel,
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, fisheye_radius, 1,
|
||||
canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
temp_dest =
|
||||
|
|
@ -330,9 +336,10 @@ Uint8 fisheye_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 2; // FIXME
|
||||
}
|
||||
|
||||
void fisheye_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void fisheye_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fisheye_radius = size * 40;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@ void flower_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
int flower_modes(magic_api * api, int which);
|
||||
Uint8 flower_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 flower_default_size(magic_api * api, int which, int mode);
|
||||
void flower_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void flower_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -435,8 +435,8 @@ static void flower_drawstalk(magic_api *api ATTRIBUTE_UNUSED,
|
|||
|
||||
/* When we're done (final render), we can add some random leaves: */
|
||||
|
||||
if (final && i > flower_petals->h && i < n_points - flower_base->h && (i % (flower_leaf->h / 2)) == 0
|
||||
&& (rand() % 5) > 0)
|
||||
if (final && i > flower_petals->h && i < n_points - flower_base->h
|
||||
&& (i % (flower_leaf->h / 2)) == 0 && (rand() % 5) > 0)
|
||||
{
|
||||
int cx, cy;
|
||||
|
||||
|
|
@ -567,9 +567,10 @@ void flower_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void flower_set_color(magic_api *api, 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 flower_set_color(magic_api *api, 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)
|
||||
{
|
||||
flower_r = r;
|
||||
flower_g = g;
|
||||
|
|
@ -720,9 +721,10 @@ Uint8 flower_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return DEFAULT_SIZE;
|
||||
}
|
||||
|
||||
void flower_set_size(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void flower_set_size(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int scale, width, height;
|
||||
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ int foam_modes(magic_api * api, int which);
|
|||
int foam_requires_colors(magic_api * api, int which);
|
||||
Uint8 foam_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 foam_default_size(magic_api * api, int which, int mode);
|
||||
void foam_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void foam_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
#define FOAM_PROP 8
|
||||
#define FOAM_RADIUS 3
|
||||
|
|
@ -461,9 +461,11 @@ void foam_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void foam_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 foam_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)
|
||||
{
|
||||
foam_r = r;
|
||||
foam_g = g;
|
||||
|
|
@ -502,8 +504,10 @@ Uint8 foam_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
|
|||
return 0;
|
||||
}
|
||||
|
||||
void foam_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,
|
||||
void foam_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,17 +69,19 @@ inline Uint8 fold_what_corner(int x, int y, SDL_Surface * canvas);
|
|||
void fold_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
Uint8 fold_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 fold_default_size(magic_api * api, int which, int mode);
|
||||
void fold_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void fold_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
Uint32 fold_api_version(void)
|
||||
{
|
||||
return (TP_MAGIC_API_VERSION);
|
||||
}
|
||||
|
||||
void fold_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 fold_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
|
||||
fold_r = r;
|
||||
|
|
@ -582,8 +584,10 @@ Uint8 fold_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
|
|||
return 0;
|
||||
}
|
||||
|
||||
void fold_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,
|
||||
void fold_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,10 +93,10 @@ void fractal_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int fractal_modes(magic_api * api, int which);
|
||||
Uint8 fractal_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 fractal_default_size(magic_api * api, int which, int mode);
|
||||
void fractal_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void do_fractal(magic_api * api, int which, SDL_Surface * canvas, int iter, float cx, float cy, float angle,
|
||||
float scale, float opacity, int final);
|
||||
void fractal_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
void do_fractal(magic_api * api, int which, SDL_Surface * canvas, int iter,
|
||||
float cx, float cy, float angle, float scale, float opacity, int final);
|
||||
|
||||
Uint32 fractal_api_version(void)
|
||||
{
|
||||
|
|
@ -154,21 +154,25 @@ char *fractal_get_description(magic_api *api ATTRIBUTE_UNUSED, int which, int mo
|
|||
if (fract_opt[which].angle != 0)
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp),
|
||||
gettext("Click and drag to sketch a shape. It will repeat, %1$s %2$d%% and rotating %3$d degrees."),
|
||||
(fract_opt[which].scale > 1.0 ? gettext("scaling up") : gettext("scaling down")),
|
||||
gettext
|
||||
("Click and drag to sketch a shape. It will repeat, %1$s %2$d%% and rotating %3$d degrees."),
|
||||
(fract_opt[which].scale >
|
||||
1.0 ? gettext("scaling up") : gettext("scaling down")),
|
||||
(int)(fract_opt[which].scale * 100), fract_opt[which].angle);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), gettext("Click and drag to sketch a shape. It will repeat, %1$s %2$d%%."),
|
||||
(fract_opt[which].scale > 1.0 ? gettext("scaling up") : gettext("scaling down")),
|
||||
(int)(fract_opt[which].scale * 100));
|
||||
snprintf(tmp, sizeof(tmp),
|
||||
gettext
|
||||
("Click and drag to sketch a shape. It will repeat, %1$s %2$d%%."),
|
||||
(fract_opt[which].scale >
|
||||
1.0 ? gettext("scaling up") : gettext("scaling down")), (int)(fract_opt[which].scale * 100));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(tmp, sizeof(tmp), gettext("Click and drag to sketch a shape. It will repeat, rotating %d degrees."),
|
||||
fract_opt[which].angle);
|
||||
snprintf(tmp, sizeof(tmp),
|
||||
gettext("Click and drag to sketch a shape. It will repeat, rotating %d degrees."), fract_opt[which].angle);
|
||||
}
|
||||
|
||||
return (strdup(tmp));
|
||||
|
|
@ -206,8 +210,8 @@ static void do_fractal_circle(void *ptr, int which ATTRIBUTE_UNUSED,
|
|||
}
|
||||
}
|
||||
|
||||
void do_fractal(magic_api *api, int which, SDL_Surface *canvas, int iter, float cx, float cy, float angle, float scale,
|
||||
float opacity, int final)
|
||||
void do_fractal(magic_api *api, int which, SDL_Surface *canvas, int iter,
|
||||
float cx, float cy, float angle, float scale, float opacity, int final)
|
||||
{
|
||||
int i;
|
||||
float x1, y1, x2, y2, nx, ny;
|
||||
|
|
@ -254,20 +258,21 @@ void do_fractal(magic_api *api, int which, SDL_Surface *canvas, int iter, float
|
|||
|
||||
fractal_radius_cur = (iter / 2) + 1;
|
||||
fractal_opacity_cur = opacity;
|
||||
api->line((void *)api, which, canvas, NULL, (int)x1, (int)y1, (int)x2, (int)y2, (final ? 1 : 10),
|
||||
do_fractal_circle);
|
||||
api->line((void *)api, which, canvas, NULL, (int)x1, (int)y1, (int)x2,
|
||||
(int)y2, (final ? 1 : 10), do_fractal_circle);
|
||||
|
||||
if (final && ((i % ((num_pts / 3) + 1)) == 1) && (iter > 1))
|
||||
{
|
||||
do_fractal(api, which, canvas, iter - 1, x2, y2, angle + ((float)fract_opt[which].angle / 180.0 * M_PI),
|
||||
do_fractal(api, which, canvas, iter - 1, x2, y2,
|
||||
angle + ((float)fract_opt[which].angle / 180.0 * M_PI),
|
||||
scale * fract_opt[which].scale, opacity * 0.5, final);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fractal_drag(magic_api *api, int which, SDL_Surface *canvas,
|
||||
SDL_Surface *last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y,
|
||||
SDL_Rect *update_rect)
|
||||
SDL_Surface *last, int ox ATTRIBUTE_UNUSED,
|
||||
int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
if (num_pts < MAX_PTS)
|
||||
{
|
||||
|
|
@ -322,8 +327,10 @@ void fractal_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(fractal_snd);
|
||||
}
|
||||
|
||||
void fractal_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,
|
||||
void fractal_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)
|
||||
{
|
||||
fractal_r = r;
|
||||
|
|
@ -362,8 +369,10 @@ Uint8 fractal_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 2;
|
||||
}
|
||||
|
||||
void fractal_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,
|
||||
void fractal_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)
|
||||
{
|
||||
fractal_radius = size + 1;
|
||||
|
|
|
|||
|
|
@ -86,8 +86,8 @@ static void fretwork_draw_wrapper(void *ptr, int which, SDL_Surface * canvas, SD
|
|||
inline unsigned int fretwork_get_segment(int x, int y);
|
||||
Uint8 fretwork_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 fretwork_default_size(magic_api * api, int which, int mode);
|
||||
void fretwork_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void fretwork_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
SDL_Surface *fretwork_one, *fretwork_three, *fretwork_four, *fretwork_corner;
|
||||
|
|
@ -102,9 +102,10 @@ int fretwork_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
|||
return (MODE_PAINT | MODE_FULLSCREEN);
|
||||
}
|
||||
|
||||
void fretwork_set_color(magic_api *api, 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 fretwork_set_color(magic_api *api, 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)
|
||||
{
|
||||
fretwork_r = r;
|
||||
fretwork_g = g;
|
||||
|
|
@ -688,8 +689,10 @@ Uint8 fretwork_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
return 0;
|
||||
}
|
||||
|
||||
void fretwork_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,
|
||||
void fretwork_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ void glasstile_switchout(magic_api * api, int which, int mode, SDL_Surface * can
|
|||
int glasstile_modes(magic_api * api, int which);
|
||||
Uint8 glasstile_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 glasstile_default_size(magic_api * api, int which, int mode);
|
||||
void glasstile_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void glasstile_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 glasstile_api_version(void)
|
||||
|
|
@ -319,10 +319,12 @@ void glasstile_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void glasstile_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)
|
||||
void glasstile_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -359,8 +361,10 @@ Uint8 glasstile_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUT
|
|||
return 0;
|
||||
}
|
||||
|
||||
void glasstile_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,
|
||||
void glasstile_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ int googlyeyes_get_order(int which);
|
|||
char *googlyeyes_get_description(magic_api * api, int which, int mode);
|
||||
int googlyeyes_requires_colors(magic_api * api, int which);
|
||||
int googlyeyes_modes(magic_api * api, int which);
|
||||
Uint8 googlyeyes_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED);
|
||||
Uint8 googlyeyes_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED);
|
||||
Uint8 googlyeyes_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED);
|
||||
void googlyeyes_shutdown(magic_api * api);
|
||||
void googlyeyes_click(magic_api * api, int which, int mode,
|
||||
|
|
@ -146,8 +146,8 @@ int googlyeyes_init(magic_api *api, Uint8 disabled_features, Uint8 complexity_le
|
|||
}
|
||||
|
||||
googlyeyes_img_bkgd[i] = api->scale(googlyeyes_img_bkgd[0],
|
||||
(googlyeyes_img_bkgd[0]->w * size) / 100,
|
||||
(googlyeyes_img_bkgd[0]->h * size) / 100, 1);
|
||||
(googlyeyes_img_bkgd[0]->w * size) /
|
||||
100, (googlyeyes_img_bkgd[0]->h * size) / 100, 1);
|
||||
|
||||
if (googlyeyes_img_bkgd[i] == NULL)
|
||||
{
|
||||
|
|
@ -156,8 +156,8 @@ int googlyeyes_init(magic_api *api, Uint8 disabled_features, Uint8 complexity_le
|
|||
}
|
||||
|
||||
googlyeyes_img_pupil[i] = api->scale(googlyeyes_img_pupil[0],
|
||||
(googlyeyes_img_pupil[0]->w * size) / 100,
|
||||
(googlyeyes_img_pupil[0]->h * size) / 100, 1);
|
||||
(googlyeyes_img_pupil[0]->w * size) /
|
||||
100, (googlyeyes_img_pupil[0]->h * size) / 100, 1);
|
||||
|
||||
if (googlyeyes_img_pupil[i] == NULL)
|
||||
{
|
||||
|
|
@ -311,9 +311,9 @@ googlyeyes_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED,
|
|||
|
||||
|
||||
void
|
||||
googlyeyes_drag(magic_api *api ATTRIBUTE_UNUSED, int which, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED,
|
||||
int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
googlyeyes_drag(magic_api *api ATTRIBUTE_UNUSED, int which,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot,
|
||||
int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
SDL_Rect dest;
|
||||
int max_radius;
|
||||
|
|
@ -375,24 +375,30 @@ googlyeyes_drag(magic_api *api ATTRIBUTE_UNUSED, int which, SDL_Surface *canvas,
|
|||
|
||||
|
||||
void
|
||||
googlyeyes_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
googlyeyes_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void googlyeyes_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)
|
||||
void googlyeyes_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void googlyeyes_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 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void googlyeyes_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 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
googlyeyes_size = (NUM_SCALEABLE_SIZES - sz) + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ void grass_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
|||
int grass_modes(magic_api * api, int which);
|
||||
Uint8 grass_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 grass_default_size(magic_api * api, int which, int mode);
|
||||
void grass_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void grass_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
// No setup required:
|
||||
int grass_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||
|
|
@ -183,8 +183,10 @@ void grass_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void grass_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,
|
||||
void grass_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)
|
||||
{
|
||||
grass_r = r;
|
||||
|
|
@ -301,8 +303,10 @@ Uint8 grass_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 0;
|
||||
}
|
||||
|
||||
void grass_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,
|
||||
void grass_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ void halftone_switchout(magic_api * api, int which, int mode, SDL_Surface * canv
|
|||
void halftone_rgb2cmyk(Uint8 r, Uint8 g, Uint8 b, float cmyk[]);
|
||||
Uint8 halftone_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 halftone_default_size(magic_api * api, int which, int mode);
|
||||
void halftone_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void halftone_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -279,10 +279,12 @@ void halftone_release(magic_api *api ATTRIBUTE_UNUSED,
|
|||
{
|
||||
}
|
||||
|
||||
void halftone_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)
|
||||
void halftone_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -453,8 +455,10 @@ Uint8 halftone_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
return 0; // No size support at this time
|
||||
}
|
||||
|
||||
void halftone_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,
|
||||
void halftone_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ void kaleidox_switchout(magic_api * api, int which, int mode, SDL_Surface * canv
|
|||
int mirror(int n, int max, int flip);
|
||||
Uint8 kaleidox_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 kaleidox_default_size(magic_api * api, int which, int mode);
|
||||
void kaleidox_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void kaleidox_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 kaleidox_api_version(void)
|
||||
|
|
@ -194,8 +194,8 @@ int mirror(int n, int max, int flip)
|
|||
|
||||
void
|
||||
kaleidox_drag(magic_api *api, int which, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED,
|
||||
int x, int y, SDL_Rect *update_rect)
|
||||
SDL_Surface *snapshot, int ox ATTRIBUTE_UNUSED,
|
||||
int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
if (snd_effects[which] != NULL)
|
||||
{
|
||||
|
|
@ -319,11 +319,12 @@ void kaleidox_release(magic_api *api, int which,
|
|||
}
|
||||
|
||||
|
||||
void kaleidox_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void kaleidox_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)
|
||||
Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED,
|
||||
Uint8 b ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -351,8 +352,10 @@ Uint8 kaleidox_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
return 0;
|
||||
}
|
||||
|
||||
void kaleidox_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,
|
||||
void kaleidox_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -278,9 +278,11 @@ int kalidescope_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which ATTRI
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void kalidescope_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 kalidescope_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)
|
||||
{
|
||||
kalidescope_r = r;
|
||||
kalidescope_g = g;
|
||||
|
|
@ -299,9 +301,11 @@ Uint8 kalidescope_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIB
|
|||
}
|
||||
|
||||
// Record the size from Tux Paint:
|
||||
void kalidescope_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 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void kalidescope_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 sz, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
kalidescope_sz = (sz * 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ void light_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
|||
int light_modes(magic_api * api, int which);
|
||||
Uint8 light_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 light_default_size(magic_api * api, int which, int mode);
|
||||
void light_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void light_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 light_api_version(void)
|
||||
|
|
@ -247,9 +247,10 @@ void light_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void light_set_color(magic_api *api, 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 light_set_color(magic_api *api, 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)
|
||||
{
|
||||
api->rgbtohsv(r, g, b, &light_h, &light_s, &light_v);
|
||||
}
|
||||
|
|
@ -286,9 +287,10 @@ Uint8 light_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 2;
|
||||
}
|
||||
|
||||
void light_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void light_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
light_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ void lightning_switchin(magic_api * api, int which, int mode, SDL_Surface * canv
|
|||
void lightning_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
Uint8 lightning_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 lightning_default_size(magic_api * api, int which, int mode);
|
||||
void lightning_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void lightning_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 lightning_api_version(void)
|
||||
|
|
@ -283,9 +283,10 @@ void lightning_draw_bolt(void *ptr, SDL_Surface *canvas,
|
|||
}
|
||||
|
||||
|
||||
void lightning_set_color(magic_api *api, 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 lightning_set_color(magic_api *api, 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)
|
||||
{
|
||||
api->rgbtohsv(r, g, b, &lightning_h, &lightning_s, &lightning_v);
|
||||
}
|
||||
|
|
@ -319,8 +320,10 @@ Uint8 lightning_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUT
|
|||
return 0;
|
||||
}
|
||||
|
||||
void lightning_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,
|
||||
void lightning_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ int check_arrays(void);
|
|||
void maze_collapse_contiguous(SDL_Surface * canvas);
|
||||
Uint8 maze_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 maze_default_size(magic_api * api, int which, int mode);
|
||||
void maze_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void maze_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 maze_api_version(void)
|
||||
|
|
@ -359,9 +359,11 @@ void maze_render(magic_api *api, SDL_Surface *canvas)
|
|||
}
|
||||
|
||||
|
||||
void maze_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 maze_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)
|
||||
{
|
||||
maze_r = r;
|
||||
maze_g = g;
|
||||
|
|
@ -468,7 +470,8 @@ void maze_switchin(magic_api *api ATTRIBUTE_UNUSED,
|
|||
|
||||
if (maze_snapshot == NULL)
|
||||
maze_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel, canvas->format->Rmask,
|
||||
canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask,
|
||||
canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
if (maze_snapshot != NULL)
|
||||
|
|
@ -588,8 +591,10 @@ Uint8 maze_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
|
|||
return 0;
|
||||
}
|
||||
|
||||
void maze_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,
|
||||
void maze_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ void metalpaint_switchout(magic_api * api, int which, int mode, SDL_Surface * ca
|
|||
int metalpaint_modes(magic_api * api, int which);
|
||||
Uint8 metalpaint_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 metalpaint_default_size(magic_api * api, int which, int mode);
|
||||
void metalpaint_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void metalpaint_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 metalpaint_api_version(void)
|
||||
|
|
@ -212,9 +212,11 @@ void metalpaint_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void metalpaint_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 metalpaint_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)
|
||||
{
|
||||
metalpaint_r = min(255, r + 64);
|
||||
metalpaint_g = min(255, g + 64);
|
||||
|
|
@ -253,9 +255,11 @@ Uint8 metalpaint_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBU
|
|||
return 2;
|
||||
}
|
||||
|
||||
void metalpaint_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void metalpaint_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
metalpaint_size = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,20 +56,21 @@ TX_EXTERN void mirror_f_drag(magic_api *, int, SDL_Surface *, SDL_Surface *, int
|
|||
TX_EXTERN void mirror_f_release(magic_api *, int, SDL_Surface *, SDL_Surface *, int, int, int, int, SDL_Rect *);
|
||||
TX_EXTERN void mirror_f_click(magic_api *, int, int, SDL_Surface *, SDL_Surface *, int, int, SDL_Rect *);
|
||||
TX_EXTERN void mirror_f_shutdown(magic_api *);
|
||||
TX_EXTERN void mirror_f_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
TX_EXTERN void mirror_f_set_color(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
TX_EXTERN int mirror_f_requires_colors(magic_api *, int);
|
||||
TX_EXTERN void mirror_f_switchin(magic_api *, int, int, SDL_Surface *);
|
||||
TX_EXTERN void mirror_f_switchout(magic_api *, int, int, SDL_Surface *);
|
||||
TX_EXTERN int mirror_f_modes(magic_api *, int);
|
||||
TX_EXTERN Uint8 mirror_f_accepted_sizes(magic_api * api, int which, int mode);
|
||||
TX_EXTERN Uint8 mirror_f_default_size(magic_api * api, int which, int mode);
|
||||
TX_EXTERN void mirror_f_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last,
|
||||
Uint8 size, SDL_Rect * update_rect);
|
||||
TX_EXTERN void mirror_f_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
// No setup required:
|
||||
TX_EXTERN int mirror_f_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED,
|
||||
Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||
TX_EXTERN int mirror_f_init(magic_api *api,
|
||||
Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||
{
|
||||
char fname[1024];
|
||||
|
||||
|
|
@ -159,16 +160,17 @@ TX_EXTERN void mirror_f_release(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 ox ATTRIBUTE_UNUSED,
|
||||
int oy ATTRIBUTE_UNUSED,
|
||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
// No-op
|
||||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
TX_EXTERN void mirror_f_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)
|
||||
TX_EXTERN void mirror_f_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 xx, yy;
|
||||
SDL_Rect src, dest;
|
||||
|
|
@ -226,10 +228,13 @@ TX_EXTERN void mirror_f_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// We don't use colors:
|
||||
TX_EXTERN void mirror_f_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)
|
||||
TX_EXTERN void mirror_f_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -240,14 +245,14 @@ TX_EXTERN int mirror_f_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int whic
|
|||
}
|
||||
|
||||
TX_EXTERN void mirror_f_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)
|
||||
{
|
||||
}
|
||||
|
||||
TX_EXTERN void mirror_f_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -257,21 +262,23 @@ TX_EXTERN int mirror_f_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUT
|
|||
}
|
||||
|
||||
|
||||
TX_EXTERN Uint8 mirror_f_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED)
|
||||
TX_EXTERN Uint8 mirror_f_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
TX_EXTERN Uint8 mirror_f_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED)
|
||||
TX_EXTERN Uint8 mirror_f_default_size(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
TX_EXTERN void mirror_f_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)
|
||||
TX_EXTERN void mirror_f_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ void mosaic_switchout(magic_api *, int, int, SDL_Surface *);
|
|||
int mosaic_modes(magic_api *, int);
|
||||
Uint8 mosaic_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 mosaic_default_size(magic_api * api, int which, int mode);
|
||||
void mosaic_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void mosaic_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
static const int mosaic_AMOUNT = 300;
|
||||
|
|
@ -315,10 +315,12 @@ void mosaic_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void mosaic_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)
|
||||
void mosaic_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -515,9 +517,10 @@ Uint8 mosaic_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 4;
|
||||
}
|
||||
|
||||
void mosaic_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void mosaic_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
mosaic_RADIUS = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ int scan_fill(magic_api * api, SDL_Surface * canvas, SDL_Surface * srfc,
|
|||
int x, int y, int fill_edge, int fill_tile, int size, Uint32 color);
|
||||
Uint8 mosaic_shaped_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 mosaic_shaped_default_size(magic_api * api, int which, int mode);
|
||||
void mosaic_shaped_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void mosaic_shaped_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint8 *mosaic_shaped_counted;
|
||||
|
|
@ -171,8 +171,8 @@ Uint32 mosaic_shaped_api_version(void)
|
|||
}
|
||||
|
||||
//Load sounds
|
||||
int mosaic_shaped_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED,
|
||||
Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||
int mosaic_shaped_init(magic_api *api,
|
||||
Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int i;
|
||||
char fname[1024];
|
||||
|
|
@ -369,8 +369,10 @@ void mosaic_shaped_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void mosaic_shaped_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r,
|
||||
void mosaic_shaped_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)
|
||||
{
|
||||
mosaic_shaped_r = r;
|
||||
|
|
@ -860,8 +862,8 @@ static void mosaic_shaped_paint(void *ptr, int which ATTRIBUTE_UNUSED,
|
|||
}
|
||||
|
||||
|
||||
Uint8 mosaic_shaped_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED)
|
||||
Uint8 mosaic_shaped_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -871,8 +873,11 @@ Uint8 mosaic_shaped_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTR
|
|||
return 0;
|
||||
}
|
||||
|
||||
void mosaic_shaped_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,
|
||||
void mosaic_shaped_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,19 +320,18 @@ void n_pt_persp_shutdown(magic_api * api);
|
|||
void n_pt_persp_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void n_pt_persp_vanish_pt_moved(magic_api * api, int which, SDL_Surface * canvas, SDL_Rect * update_rect);
|
||||
void n_pt_persp_drag(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot,
|
||||
int old_x, int old_y, int x, int y, SDL_Rect * update_rect);
|
||||
void n_pt_persp_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int old_x, int old_y, int x, int y, SDL_Rect * update_rect);
|
||||
void n_pt_persp_work(magic_api * api, int tool, SDL_Surface * canvas, int x, int y, SDL_Rect * update_rect, int xor);
|
||||
void n_pt_persp_release(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void n_pt_persp_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void n_pt_persp_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
void n_pt_persp_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
void n_pt_persp_line_xor_callback(void *pointer, int tool, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
|
||||
void n_pt_persp_line_xor_thick_callback(void *pointer, int tool, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y);
|
||||
void n_pt_persp_line_xor_thick_callback(void *pointer, int tool,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
|
||||
void n_pt_persp_line_callback(void *pointer, int tool, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
|
||||
void n_pt_persp_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
void n_pt_persp_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
|
|
@ -525,9 +524,10 @@ int n_pt_persp_requires_colors(magic_api *api ATTRIBUTE_UNUSED, int which)
|
|||
|
||||
which = which_to_tool[which];
|
||||
|
||||
if (which == TOOL_1PT_DRAW || which == TOOL_2PT_DRAW || which == TOOL_3PT_DRAW || which == TOOL_3PT_DRAW_ALT ||
|
||||
which == TOOL_ISO_DRAW || which == TOOL_DIM_DRAW || which == TOOL_TRI_DRAW ||
|
||||
which == TOOL_OBLQ_DRAW || which == TOOL_OBLQ_DRAW_ALT)
|
||||
if (which == TOOL_1PT_DRAW || which == TOOL_2PT_DRAW
|
||||
|| which == TOOL_3PT_DRAW || which == TOOL_3PT_DRAW_ALT
|
||||
|| which == TOOL_ISO_DRAW || which == TOOL_DIM_DRAW
|
||||
|| which == TOOL_TRI_DRAW || which == TOOL_OBLQ_DRAW || which == TOOL_OBLQ_DRAW_ALT)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
|
@ -549,9 +549,10 @@ Uint8 n_pt_persp_accepted_sizes(magic_api *api ATTRIBUTE_UNUSED, int which, int
|
|||
|
||||
which = which_to_tool[which];
|
||||
|
||||
if (which == TOOL_1PT_DRAW || which == TOOL_2PT_DRAW || which == TOOL_3PT_DRAW || which == TOOL_3PT_DRAW_ALT ||
|
||||
which == TOOL_ISO_DRAW || which == TOOL_DIM_DRAW || which == TOOL_TRI_DRAW ||
|
||||
which == TOOL_OBLQ_DRAW || which == TOOL_OBLQ_DRAW_ALT)
|
||||
if (which == TOOL_1PT_DRAW || which == TOOL_2PT_DRAW
|
||||
|| which == TOOL_3PT_DRAW || which == TOOL_3PT_DRAW_ALT
|
||||
|| which == TOOL_ISO_DRAW || which == TOOL_DIM_DRAW
|
||||
|| which == TOOL_TRI_DRAW || which == TOOL_OBLQ_DRAW || which == TOOL_OBLQ_DRAW_ALT)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
|
@ -804,7 +805,8 @@ void n_pt_persp_vanish_pt_moved(magic_api *api, int which, SDL_Surface *canvas,
|
|||
|
||||
/* Affect the canvas on drag: */
|
||||
void n_pt_persp_drag(magic_api *api, int which,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
int old_x ATTRIBUTE_UNUSED, int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
int i, x1, y1, x2, y2;
|
||||
|
|
@ -955,8 +957,8 @@ void n_pt_persp_drag(magic_api *api, int which,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (which == TOOL_ISO_DRAW || which == TOOL_DIM_DRAW || which == TOOL_TRI_DRAW ||
|
||||
which == TOOL_OBLQ_DRAW || which == TOOL_OBLQ_DRAW_ALT)
|
||||
else if (which == TOOL_ISO_DRAW || which == TOOL_DIM_DRAW
|
||||
|| which == TOOL_TRI_DRAW || which == TOOL_OBLQ_DRAW || which == TOOL_OBLQ_DRAW_ALT)
|
||||
{
|
||||
int guide_len;
|
||||
|
||||
|
|
@ -987,18 +989,21 @@ void n_pt_persp_drag(magic_api *api, int which,
|
|||
x - cosf(dim_ang) * guide_len, y + sinf(dim_ang) * guide_len,
|
||||
x + cosf(dim_ang) * guide_len, y - sinf(dim_ang) * guide_len, 6, n_pt_persp_line_xor_callback);
|
||||
api->line((void *)api, which, canvas, NULL,
|
||||
x - cosf(M_PI - dim_ang) * guide_len, y + sinf(M_PI - dim_ang) * guide_len,
|
||||
x + cosf(M_PI - dim_ang) * guide_len, y - sinf(M_PI - dim_ang) * guide_len,
|
||||
6, n_pt_persp_line_xor_callback);
|
||||
x - cosf(M_PI - dim_ang) * guide_len,
|
||||
y + sinf(M_PI - dim_ang) * guide_len,
|
||||
x + cosf(M_PI - dim_ang) * guide_len,
|
||||
y - sinf(M_PI - dim_ang) * guide_len, 6, n_pt_persp_line_xor_callback);
|
||||
}
|
||||
else if (which == TOOL_TRI_DRAW)
|
||||
{
|
||||
/* Trimetric */
|
||||
api->line((void *)api, which, canvas, NULL,
|
||||
x - cosf(tri_ang[0]) * guide_len, y + sinf(tri_ang[0]) * guide_len,
|
||||
x - cosf(tri_ang[0]) * guide_len,
|
||||
y + sinf(tri_ang[0]) * guide_len,
|
||||
x + cosf(tri_ang[0]) * guide_len, y - sinf(tri_ang[0]) * guide_len, 6, n_pt_persp_line_xor_callback);
|
||||
api->line((void *)api, which, canvas, NULL,
|
||||
x - cosf(tri_ang[1]) * guide_len, y + sinf(tri_ang[1]) * guide_len,
|
||||
x - cosf(tri_ang[1]) * guide_len,
|
||||
y + sinf(tri_ang[1]) * guide_len,
|
||||
x + cosf(tri_ang[1]) * guide_len, y - sinf(tri_ang[1]) * guide_len, 6, n_pt_persp_line_xor_callback);
|
||||
}
|
||||
else if (which == TOOL_OBLQ_DRAW || which == TOOL_OBLQ_DRAW_ALT)
|
||||
|
|
@ -1287,8 +1292,8 @@ void n_pt_persp_work(magic_api *api, int tool, SDL_Surface *canvas, int x, int y
|
|||
y2 = y;
|
||||
}
|
||||
}
|
||||
else if (tool == TOOL_ISO_DRAW || tool == TOOL_DIM_DRAW || tool == TOOL_TRI_DRAW ||
|
||||
tool == TOOL_OBLQ_DRAW || tool == TOOL_OBLQ_DRAW_ALT)
|
||||
else if (tool == TOOL_ISO_DRAW || tool == TOOL_DIM_DRAW
|
||||
|| tool == TOOL_TRI_DRAW || tool == TOOL_OBLQ_DRAW || tool == TOOL_OBLQ_DRAW_ALT)
|
||||
{
|
||||
float valid_angles[6];
|
||||
float ang;
|
||||
|
|
@ -1456,8 +1461,8 @@ void n_pt_persp_work(magic_api *api, int tool, SDL_Surface *canvas, int x, int y
|
|||
|
||||
|
||||
void n_pt_persp_release(magic_api *api, int which,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
int x, int y, SDL_Rect *update_rect)
|
||||
SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("\nn_pt_persp_release\n");
|
||||
|
|
@ -1514,10 +1519,11 @@ void n_pt_persp_release(magic_api *api, int which,
|
|||
}
|
||||
|
||||
|
||||
void n_pt_persp_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void n_pt_persp_set_color(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, Uint8 r,
|
||||
Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
n_pt_persp_r = r;
|
||||
n_pt_persp_g = g;
|
||||
|
|
@ -1525,16 +1531,18 @@ void n_pt_persp_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
}
|
||||
|
||||
|
||||
void n_pt_persp_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void n_pt_persp_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
n_pt_persp_size = ((size - 1) * 2) + 1;
|
||||
}
|
||||
|
||||
|
||||
void n_pt_persp_line_xor_callback(void *pointer, int tool ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
void n_pt_persp_line_xor_callback(void *pointer, int tool ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
{
|
||||
magic_api *api = (magic_api *) pointer;
|
||||
|
||||
|
|
@ -1542,8 +1550,9 @@ void n_pt_persp_line_xor_callback(void *pointer, int tool ATTRIBUTE_UNUSED, SDL_
|
|||
api->xorpixel(canvas, x + 1, y + 1);
|
||||
}
|
||||
|
||||
void n_pt_persp_line_xor_thick_callback(void *pointer, int tool ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
void n_pt_persp_line_xor_thick_callback(void *pointer,
|
||||
int tool ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
|
@ -1561,8 +1570,9 @@ void n_pt_persp_line_xor_thick_callback(void *pointer, int tool ATTRIBUTE_UNUSED
|
|||
}
|
||||
}
|
||||
|
||||
void n_pt_persp_line_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
void n_pt_persp_line_callback(void *pointer ATTRIBUTE_UNUSED,
|
||||
int tool ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
{
|
||||
SDL_Rect r;
|
||||
|
||||
|
|
@ -1584,8 +1594,8 @@ void n_pt_persp_switchin(magic_api *api, int which, int mode ATTRIBUTE_UNUSED, S
|
|||
|
||||
which = which_to_tool[which];
|
||||
|
||||
if (which == TOOL_1PT_SELECT || which == TOOL_2PT_SELECT || which == TOOL_3PT_SELECT ||
|
||||
which == TOOL_DIM_SELECT || which == TOOL_TRI_SELECT || which == TOOL_OBLQ_SELECT)
|
||||
if (which == TOOL_1PT_SELECT || which == TOOL_2PT_SELECT
|
||||
|| which == TOOL_3PT_SELECT || which == TOOL_DIM_SELECT || which == TOOL_TRI_SELECT || which == TOOL_OBLQ_SELECT)
|
||||
{
|
||||
SDL_BlitSurface(canvas, NULL, n_pt_persp_snapshot, NULL);
|
||||
|
||||
|
|
@ -1603,8 +1613,8 @@ void n_pt_persp_switchout(magic_api *api ATTRIBUTE_UNUSED, int which, int mode A
|
|||
|
||||
which = which_to_tool[which];
|
||||
|
||||
if (which == TOOL_1PT_SELECT || which == TOOL_2PT_SELECT || which == TOOL_3PT_SELECT ||
|
||||
which == TOOL_DIM_SELECT || which == TOOL_TRI_SELECT || which == TOOL_OBLQ_SELECT)
|
||||
if (which == TOOL_1PT_SELECT || which == TOOL_2PT_SELECT
|
||||
|| which == TOOL_3PT_SELECT || which == TOOL_DIM_SELECT || which == TOOL_TRI_SELECT || which == TOOL_OBLQ_SELECT)
|
||||
{
|
||||
SDL_BlitSurface(n_pt_persp_snapshot, NULL, canvas, NULL);
|
||||
}
|
||||
|
|
@ -1788,9 +1798,8 @@ void n_pt_persp_draw_points(magic_api *api, int tool, SDL_Surface *canvas)
|
|||
api->line((void *)api, tool, canvas, NULL,
|
||||
canvas->w / 2 - x1, canvas->h / 2 - y1,
|
||||
canvas->w / 2 + x1, canvas->h / 2 + y1, 12, n_pt_persp_line_xor_callback);
|
||||
api->line((void *)api, tool, canvas, NULL,
|
||||
canvas->w / 2 - x1, canvas->h / 2 + y1,
|
||||
canvas->w / 2 + x1, canvas->h / 2 - y1, 12, n_pt_persp_line_xor_callback);
|
||||
api->line((void *)api, tool, canvas, NULL, canvas->w / 2 - x1,
|
||||
canvas->h / 2 + y1, canvas->w / 2 + x1, canvas->h / 2 - y1, 12, n_pt_persp_line_xor_callback);
|
||||
}
|
||||
else if (tool == TOOL_DIM_SELECT)
|
||||
{
|
||||
|
|
@ -1806,9 +1815,8 @@ void n_pt_persp_draw_points(magic_api *api, int tool, SDL_Surface *canvas)
|
|||
api->line((void *)api, tool, canvas, NULL,
|
||||
canvas->w / 2 - x1, canvas->h / 2 - y1,
|
||||
canvas->w / 2 + x1, canvas->h / 2 + y1, 12, n_pt_persp_line_xor_thick_callback);
|
||||
api->line((void *)api, tool, canvas, NULL,
|
||||
canvas->w / 2 - x1, canvas->h / 2 + y1,
|
||||
canvas->w / 2 + x1, canvas->h / 2 - y1, 12, n_pt_persp_line_xor_thick_callback);
|
||||
api->line((void *)api, tool, canvas, NULL, canvas->w / 2 - x1,
|
||||
canvas->h / 2 + y1, canvas->w / 2 + x1, canvas->h / 2 - y1, 12, n_pt_persp_line_xor_thick_callback);
|
||||
}
|
||||
else if (tool == TOOL_TRI_SELECT)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ void negative_switchout(magic_api * api, int which, int mode, SDL_Surface * canv
|
|||
int negative_modes(magic_api * api, int which);
|
||||
Uint8 negative_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 negative_default_size(magic_api * api, int which, int mode);
|
||||
void negative_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void negative_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
@ -286,10 +286,12 @@ void negative_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// We don't use colors
|
||||
void negative_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)
|
||||
void negative_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -328,9 +330,10 @@ Uint8 negative_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
return 4;
|
||||
}
|
||||
|
||||
void negative_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void negative_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
negative_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ int noise_modes(magic_api * api, int which);
|
|||
int noise_get_tool_count(magic_api * api ATTRIBUTE_UNUSED);
|
||||
Uint8 noise_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 noise_default_size(magic_api * api, int which, int mode);
|
||||
void noise_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void noise_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 noise_api_version(void)
|
||||
|
|
@ -290,10 +290,12 @@ void noise_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void noise_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)
|
||||
void noise_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -332,9 +334,10 @@ Uint8 noise_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 4;
|
||||
}
|
||||
|
||||
void noise_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void noise_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
noise_RADIUS = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ void perspective_line(void *ptr_to_api, int which, SDL_Surface * canvas, SDL_Sur
|
|||
|
||||
Uint8 perspective_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 perspective_default_size(magic_api * api, int which, int mode);
|
||||
void perspective_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void perspective_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -883,8 +883,11 @@ Uint8 perspective_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIB
|
|||
return 0;
|
||||
}
|
||||
|
||||
void perspective_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,
|
||||
void perspective_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ 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:
|
||||
|
|
@ -209,8 +209,10 @@ 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,
|
||||
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;
|
||||
|
|
@ -250,9 +252,10 @@ Uint8 pixels_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -92,20 +92,17 @@ void polyfill_shutdown(magic_api * api);
|
|||
void
|
||||
polyfill_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void
|
||||
polyfill_drag(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int old_x, int old_y, int x, int y, SDL_Rect * update_rect);
|
||||
void
|
||||
polyfill_release(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void polyfill_set_color(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * snapshot, Uint8 r, Uint8 g,
|
||||
Uint8 b, SDL_Rect * update_rect);
|
||||
void polyfill_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * snapshot, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void polyfill_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int old_x, int old_y, int x, int y, SDL_Rect * update_rect);
|
||||
void polyfill_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void polyfill_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
void polyfill_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, Uint8 size, SDL_Rect * update_rect);
|
||||
void polyfill_line_callback(void *pointer, int which, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
|
||||
void
|
||||
polyfill_release(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void polyfill_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void polyfill_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
void polyfill_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
void polyfill_draw_preview(magic_api * api, SDL_Surface * canvas, int show_handles);
|
||||
|
|
@ -218,8 +215,9 @@ void polyfill_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
void
|
||||
polyfill_click(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect)
|
||||
polyfill_click(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -285,8 +283,8 @@ polyfill_click(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UN
|
|||
|
||||
void
|
||||
polyfill_drag(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int old_x ATTRIBUTE_UNUSED,
|
||||
int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
int old_x ATTRIBUTE_UNUSED, int old_y ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
polyfill_dragged = 1;
|
||||
|
||||
|
|
@ -383,8 +381,8 @@ void polyfill_draw_preview(magic_api *api, SDL_Surface *canvas, int show_handles
|
|||
|
||||
void
|
||||
polyfill_release(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
int x, int y, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -448,7 +446,9 @@ polyfill_release(magic_api *api, int which ATTRIBUTE_UNUSED,
|
|||
SDL_BlitSurface(canvas, NULL, polyfill_snapshot, NULL);
|
||||
|
||||
/* Play "finish" sound effect */
|
||||
api->playsound(snd_effects[SND_FINISH], 128 /* TODO could be clever and determine midpoint of polygon */ , 255);
|
||||
api->playsound(snd_effects[SND_FINISH], 128
|
||||
/* TODO could be clever and determine midpoint of polygon */
|
||||
, 255);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("Retract the undo we just took (ahead of finishing polygon)!\n");
|
||||
|
|
@ -518,7 +518,8 @@ polyfill_release(magic_api *api, int which ATTRIBUTE_UNUSED,
|
|||
}
|
||||
}
|
||||
|
||||
void polyfill_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
void polyfill_set_color(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect)
|
||||
{
|
||||
polyfill_color = SDL_MapRGB(canvas->format, r, g, b);
|
||||
|
|
@ -533,14 +534,17 @@ void polyfill_set_color(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface
|
|||
}
|
||||
}
|
||||
|
||||
void polyfill_set_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
void polyfill_set_size(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
Uint8 size ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void polyfill_line_callback(void *pointer ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
void polyfill_line_callback(void *pointer ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
{
|
||||
SDL_Rect dest;
|
||||
|
|
@ -554,17 +558,18 @@ void polyfill_line_callback(void *pointer ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
}
|
||||
|
||||
|
||||
void polyfill_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas)
|
||||
void polyfill_switchin(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas)
|
||||
{
|
||||
polyfill_color_red = SDL_MapRGB(canvas->format, 255, 0, 0);
|
||||
polyfill_color_green = SDL_MapRGB(canvas->format, 0, 255, 0);
|
||||
|
||||
if (polyfill_snapshot == NULL)
|
||||
{
|
||||
polyfill_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel, canvas->format->Rmask,
|
||||
canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
polyfill_snapshot =
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
}
|
||||
|
||||
if (polyfill_snapshot != NULL)
|
||||
|
|
@ -575,8 +580,8 @@ void polyfill_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS
|
|||
polyfill_active = 1;
|
||||
}
|
||||
|
||||
void polyfill_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas)
|
||||
void polyfill_switchout(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas)
|
||||
{
|
||||
if (polyfill_num_pts > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ void puzzle_click(magic_api * api, int which, int mode,
|
|||
int gcd(int a, int b);
|
||||
Uint8 puzzle_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 puzzle_default_size(magic_api * api, int which, int mode);
|
||||
void puzzle_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void puzzle_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
Uint32 puzzle_api_version(void)
|
||||
{
|
||||
|
|
@ -145,10 +145,12 @@ void puzzle_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(puzzle_snd);
|
||||
}
|
||||
|
||||
void puzzle_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)
|
||||
void puzzle_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -281,8 +283,8 @@ Uint8 puzzle_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 4;
|
||||
}
|
||||
|
||||
void puzzle_set_size(magic_api *api, int which, int mode, SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED,
|
||||
Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void puzzle_set_size(magic_api *api, int which, int mode, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
RATIO = size + 1;
|
||||
puzzle_switchin(api, which, mode, canvas);
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ void rails_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect);
|
||||
Uint8 rails_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 rails_default_size(magic_api * api, int which, int mode);
|
||||
void rails_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void rails_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
Uint32 rails_api_version(void)
|
||||
{
|
||||
|
|
@ -96,10 +96,12 @@ int rails_modes(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
|||
return (MODE_PAINT);
|
||||
}
|
||||
|
||||
void rails_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)
|
||||
void rails_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -618,8 +620,10 @@ Uint8 rails_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 0;
|
||||
}
|
||||
|
||||
void rails_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,
|
||||
void rails_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,8 +105,8 @@ void rain_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
|||
int rain_modes(magic_api * api, int which);
|
||||
Uint8 rain_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 rain_default_size(magic_api * api, int which, int mode);
|
||||
void rain_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void rain_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 rain_api_version(void)
|
||||
|
|
@ -303,8 +303,11 @@ void rain_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void rain_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,
|
||||
void rain_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)
|
||||
{
|
||||
}
|
||||
|
|
@ -343,9 +346,10 @@ Uint8 rain_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
|
|||
return 2;
|
||||
}
|
||||
|
||||
void rain_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void rain_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
rain_SIZE = size * 15;
|
||||
rain_AMOUNT = 400 / size;
|
||||
|
|
|
|||
|
|
@ -107,8 +107,8 @@ void rainbow_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int rainbow_modes(magic_api * api, int which);
|
||||
Uint8 rainbow_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 rainbow_default_size(magic_api * api, int which, int mode);
|
||||
void rainbow_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void rainbow_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 rainbow_api_version(void)
|
||||
|
|
@ -298,10 +298,12 @@ void rainbow_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void rainbow_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)
|
||||
void rainbow_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -337,9 +339,10 @@ Uint8 rainbow_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 4;
|
||||
}
|
||||
|
||||
void rainbow_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void rainbow_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
rainbow_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ void realrainbow_switchin(magic_api * api, int which, int mode, SDL_Surface * ca
|
|||
void realrainbow_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
||||
Uint8 realrainbow_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 realrainbow_default_size(magic_api * api, int which, int mode);
|
||||
void realrainbow_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void realrainbow_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 realrainbow_api_version(void)
|
||||
|
|
@ -146,10 +146,12 @@ void realrainbow_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(realrainbow_snd);
|
||||
}
|
||||
|
||||
void realrainbow_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)
|
||||
void realrainbow_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -401,8 +403,11 @@ Uint8 realrainbow_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIB
|
|||
return 0;
|
||||
}
|
||||
|
||||
void realrainbow_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,
|
||||
void realrainbow_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ void reflection_switchout(magic_api * api, int which, int mode, SDL_Surface * ca
|
|||
int reflection_modes(magic_api * api, int which);
|
||||
Uint8 reflection_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 reflection_default_size(magic_api * api, int which, int mode);
|
||||
void reflection_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void reflection_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -386,10 +386,12 @@ void reflection_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(reflection_snd);
|
||||
}
|
||||
|
||||
void reflection_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)
|
||||
void reflection_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -426,8 +428,11 @@ Uint8 reflection_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBU
|
|||
return 0;
|
||||
}
|
||||
|
||||
void reflection_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,
|
||||
void reflection_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ void ribbon_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
int ribbon_modes(magic_api * api, int which);
|
||||
Uint8 ribbon_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 ribbon_default_size(magic_api * api, int which, int mode);
|
||||
void ribbon_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void ribbon_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 ribbon_api_version(void)
|
||||
|
|
@ -248,9 +248,11 @@ void ribbon_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void ribbon_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 ribbon_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)
|
||||
{
|
||||
ribbon_r = r;
|
||||
ribbon_g = g;
|
||||
|
|
@ -289,9 +291,10 @@ Uint8 ribbon_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return (NUM_LENGTH_OPTIONS / 2);
|
||||
}
|
||||
|
||||
void ribbon_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void ribbon_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ribbon_max_length = (size * MAX_LENGTH) / NUM_LENGTH_OPTIONS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ void ripples_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int ripples_modes(magic_api * api, int which);
|
||||
Uint8 ripples_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 ripples_default_size(magic_api * api, int which, int mode);
|
||||
void ripples_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void ripples_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 ripples_api_version(void)
|
||||
|
|
@ -205,10 +205,12 @@ void ripples_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void ripples_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)
|
||||
void ripples_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -244,9 +246,10 @@ Uint8 ripples_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 5;
|
||||
}
|
||||
|
||||
void ripples_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void ripples_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ripples_radius = ((float)size) * 20.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ int rosette_modes(magic_api * api, int which);
|
|||
void rosette_circle(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
|
||||
Uint8 rosette_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 rosette_default_size(magic_api * api, int which, int mode);
|
||||
void rosette_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void rosette_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 rosette_api_version(void)
|
||||
|
|
@ -86,8 +86,10 @@ Uint32 rosette_api_version(void)
|
|||
return (TP_MAGIC_API_VERSION);
|
||||
}
|
||||
|
||||
void rosette_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,
|
||||
void rosette_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
|
||||
|
|
@ -278,9 +280,10 @@ Uint8 rosette_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 1;
|
||||
}
|
||||
|
||||
void rosette_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void rosette_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
ROSETTE_R = (size + 2) * 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ void rotate_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
int rotate_modes(magic_api * api, int which);
|
||||
Uint8 rotate_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 rotate_default_size(magic_api * api, int which, int mode);
|
||||
void rotate_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void rotate_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
float do_rotate(SDL_Surface * canvas, int x, int y, int smoothing_flag);
|
||||
void rotate_xorline_callback(void *pointer, int tool, SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y);
|
||||
|
||||
|
|
@ -158,17 +158,18 @@ float do_rotate(SDL_Surface *canvas, int x, int y, int smoothing_flag)
|
|||
return angle_rad;
|
||||
}
|
||||
|
||||
void rotate_xorline_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
void rotate_xorline_callback(void *pointer ATTRIBUTE_UNUSED,
|
||||
int tool ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
{
|
||||
magic_api *api = (magic_api *) pointer;
|
||||
|
||||
api->xorpixel(canvas, x, y);
|
||||
}
|
||||
|
||||
void rotate_drag(magic_api *api, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED,
|
||||
int x, int y, SDL_Rect *update_rect)
|
||||
void rotate_drag(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *last,
|
||||
int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
float ang;
|
||||
int xx, yy;
|
||||
|
|
@ -215,8 +216,9 @@ void rotate_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED,
|
|||
rotate_drag(api, which, canvas, last, x, y, x, y, update_rect);
|
||||
}
|
||||
|
||||
void rotate_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
void rotate_release(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
/* Final rotation work; and now, record the final angle
|
||||
* we landed at, so we can reuse it -- both for stacking up
|
||||
|
|
@ -250,7 +252,8 @@ void rotate_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
}
|
||||
|
||||
void rotate_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
void rotate_set_color(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect)
|
||||
{
|
||||
/* Record the new color */
|
||||
|
|
@ -279,9 +282,10 @@ void rotate_switchin(magic_api *api ATTRIBUTE_UNUSED,
|
|||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas)
|
||||
{
|
||||
if (rotate_snapshot == NULL)
|
||||
rotate_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel, canvas->format->Rmask,
|
||||
canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
rotate_snapshot =
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
if (rotate_snapshot != NULL)
|
||||
{
|
||||
|
|
@ -322,8 +326,10 @@ Uint8 rotate_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 0;
|
||||
}
|
||||
|
||||
void rotate_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,
|
||||
void rotate_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ void sharpen_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int sharpen_modes(magic_api * api, int which);
|
||||
Uint8 sharpen_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 sharpen_default_size(magic_api * api, int which, int mode);
|
||||
void sharpen_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void sharpen_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -366,10 +366,12 @@ void sharpen_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void sharpen_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)
|
||||
void sharpen_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -409,9 +411,10 @@ Uint8 sharpen_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 4;
|
||||
}
|
||||
|
||||
void sharpen_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void sharpen_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
sharpen_RADIUS = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ int shift_modes(magic_api * api, int which);
|
|||
|
||||
Uint8 shift_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 shift_default_size(magic_api * api, int which, int mode);
|
||||
void shift_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void shift_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -331,10 +331,12 @@ void shift_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void shift_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)
|
||||
void shift_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -370,8 +372,10 @@ Uint8 shift_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 0;
|
||||
}
|
||||
|
||||
void shift_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,
|
||||
void shift_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,12 +105,12 @@ int smooth_get_group(magic_api * api, int which);
|
|||
int smooth_get_order(int which);
|
||||
char *smooth_get_description(magic_api * api, int which, int mode);
|
||||
static void smooth_linecb(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y);
|
||||
static void smooth_squiggle_linecb(void *ptr, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y);
|
||||
static void smooth_squiggle_linecb(void *ptr, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last ATTRIBUTE_UNUSED, int x, int y);
|
||||
void smooth_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 smooth_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void smooth_click(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void smooth_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect);
|
||||
void smooth_shutdown(magic_api * api);
|
||||
|
|
@ -122,8 +122,8 @@ void smooth_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
int smooth_modes(magic_api * api, int which);
|
||||
Uint8 smooth_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 smooth_default_size(magic_api * api, int which, int mode);
|
||||
void smooth_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void smooth_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -400,8 +400,8 @@ void smooth_release(magic_api *api,
|
|||
|
||||
for (i = 0; i < n_points - 1; i++)
|
||||
{
|
||||
api->line((void *)api, which, canvas, last, curve[i].x, curve[i].y, curve[i + 1].x, curve[i + 1].y, 1,
|
||||
smooth_linecb);
|
||||
api->line((void *)api, which, canvas, last, curve[i].x, curve[i].y,
|
||||
curve[i + 1].x, curve[i + 1].y, 1, smooth_linecb);
|
||||
}
|
||||
|
||||
free(curve);
|
||||
|
|
@ -429,10 +429,10 @@ void smooth_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
}
|
||||
|
||||
void smooth_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void smooth_set_color(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g,
|
||||
Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
smooth_color = SDL_MapRGB(canvas->format, r, g, b);
|
||||
}
|
||||
|
|
@ -538,9 +538,10 @@ Uint8 smooth_default_size(magic_api *api ATTRIBUTE_UNUSED, int which, int mode A
|
|||
return smooth_sizes[which] / 2;
|
||||
}
|
||||
|
||||
void smooth_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void smooth_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
smooth_size = size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ int smudge_modes(magic_api * api, int which);
|
|||
int smudge_get_tool_count(magic_api * api);
|
||||
Uint8 smudge_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 smudge_default_size(magic_api * api, int which, int mode);
|
||||
void smudge_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void smudge_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
int smudge_init(magic_api *api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||
|
|
@ -249,8 +249,10 @@ void smudge_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void smudge_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,
|
||||
void smudge_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)
|
||||
{
|
||||
smudge_r = r;
|
||||
|
|
@ -294,9 +296,10 @@ Uint8 smudge_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 4;
|
||||
}
|
||||
|
||||
void smudge_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void smudge_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
smudge_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,8 +107,8 @@ 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)
|
||||
|
|
@ -283,8 +283,11 @@ 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,
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
|
@ -322,8 +325,10 @@ Uint8 snow_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
|
|||
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,
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,8 +112,8 @@ void spiral_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
int spiral_modes(magic_api * api, int which);
|
||||
Uint8 spiral_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 spiral_default_size(magic_api * api, int which, int mode);
|
||||
void spiral_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void spiral_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
void do_spiral(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int x, int y, SDL_Rect * update_rect, int final);
|
||||
|
|
@ -324,12 +324,12 @@ void do_spiral(magic_api *api, int which, SDL_Surface *canvas,
|
|||
{
|
||||
api->line((void *)api, which, canvas, NULL,
|
||||
spiral_cx - i, spiral_cy - i, spiral_cx + i, spiral_cy - i, 1, do_spiral_render);
|
||||
api->line((void *)api, which, canvas, NULL,
|
||||
spiral_cx + i, spiral_cy - i, spiral_cx + i, spiral_cy + i, 1, do_spiral_render);
|
||||
api->line((void *)api, which, canvas, NULL,
|
||||
spiral_cx + i, spiral_cy + i, spiral_cx - i, spiral_cy + i, 1, do_spiral_render);
|
||||
api->line((void *)api, which, canvas, NULL,
|
||||
spiral_cx - i, spiral_cy + i, spiral_cx - i, spiral_cy - i, 1, do_spiral_render);
|
||||
api->line((void *)api, which, canvas, NULL, spiral_cx + i,
|
||||
spiral_cy - i, spiral_cx + i, spiral_cy + i, 1, do_spiral_render);
|
||||
api->line((void *)api, which, canvas, NULL, spiral_cx + i,
|
||||
spiral_cy + i, spiral_cx - i, spiral_cy + i, 1, do_spiral_render);
|
||||
api->line((void *)api, which, canvas, NULL, spiral_cx - i,
|
||||
spiral_cy + i, spiral_cx - i, spiral_cy - i, 1, do_spiral_render);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -349,8 +349,8 @@ void do_spiral(magic_api *api, int which, SDL_Surface *canvas,
|
|||
}
|
||||
|
||||
void spiral_drag(magic_api *api, int which, SDL_Surface *canvas,
|
||||
SDL_Surface *last, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int x, int y,
|
||||
SDL_Rect *update_rect)
|
||||
SDL_Surface *last, int ox ATTRIBUTE_UNUSED,
|
||||
int oy ATTRIBUTE_UNUSED, int x, int y, SDL_Rect *update_rect)
|
||||
{
|
||||
spiral_has_dragged = 1;
|
||||
do_spiral(api, which, canvas, last, x, y, update_rect, 0);
|
||||
|
|
@ -389,9 +389,10 @@ void spiral_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(spiral_snd[i]);
|
||||
}
|
||||
|
||||
void spiral_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g, Uint8 b,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void spiral_set_color(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g,
|
||||
Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
spiral_color = SDL_MapRGB(canvas->format, r, g, b);
|
||||
}
|
||||
|
|
@ -427,8 +428,10 @@ Uint8 spiral_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 4;
|
||||
}
|
||||
|
||||
void spiral_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,
|
||||
void spiral_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)
|
||||
{
|
||||
spiral_thickness = size;
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ void spraypaint_switchout(magic_api * api, int which, int mode, SDL_Surface * ca
|
|||
int spraypaint_modes(magic_api * api, int which);
|
||||
Uint8 spraypaint_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 spraypaint_default_size(magic_api * api, int which, int mode);
|
||||
void spraypaint_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void spraypaint_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 spraypaint_api_version(void)
|
||||
|
|
@ -194,10 +194,11 @@ void spraypaint_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED,
|
|||
spraypaint_drag(api, which, canvas, last, x, y, x, y, update_rect);
|
||||
}
|
||||
|
||||
void spraypaint_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void spraypaint_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)
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED,
|
||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
api->stopsound();
|
||||
if (spraypaint_cnt >= 1000)
|
||||
|
|
@ -215,9 +216,11 @@ void spraypaint_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(spraypaint_snd_shake);
|
||||
}
|
||||
|
||||
void spraypaint_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 spraypaint_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)
|
||||
{
|
||||
spraypaint_r = r;
|
||||
spraypaint_g = g;
|
||||
|
|
@ -256,8 +259,11 @@ Uint8 spraypaint_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBU
|
|||
return 4;
|
||||
}
|
||||
|
||||
void spraypaint_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,
|
||||
void spraypaint_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)
|
||||
{
|
||||
spraypaint_radius = size * 8;
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ void stretch_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int stretch_modes(magic_api * api, int which);
|
||||
Uint8 stretch_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 stretch_default_size(magic_api * api, int which, int mode);
|
||||
void stretch_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void stretch_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
// Housekeeping functions
|
||||
Uint32 stretch_api_version(void)
|
||||
|
|
@ -83,10 +83,12 @@ Uint32 stretch_api_version(void)
|
|||
return (TP_MAGIC_API_VERSION);
|
||||
}
|
||||
|
||||
void stretch_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)
|
||||
void stretch_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -313,8 +315,10 @@ Uint8 stretch_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 0;
|
||||
}
|
||||
|
||||
void stretch_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,
|
||||
void stretch_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,8 +73,10 @@ void string_click(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
|||
SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
Uint8 string_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED);
|
||||
Uint8 string_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED);
|
||||
void string_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,
|
||||
void string_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);
|
||||
|
||||
// Required functions
|
||||
|
|
@ -92,8 +94,10 @@ int string_modes(magic_api *api ATTRIBUTE_UNUSED, int which)
|
|||
return (MODE_PAINT_WITH_PREVIEW);
|
||||
}
|
||||
|
||||
void string_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,
|
||||
void string_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)
|
||||
{
|
||||
string_r = r;
|
||||
|
|
@ -551,8 +555,10 @@ Uint8 string_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 0;
|
||||
}
|
||||
|
||||
void string_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,
|
||||
void string_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ void swirls_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
double get_angle(int x, int y, int target_x, int target_y);
|
||||
Uint8 swirls_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 swirls_default_size(magic_api * api, int which, int mode);
|
||||
void swirls_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void swirls_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 swirls_api_version(void)
|
||||
|
|
@ -286,10 +286,11 @@ void swirls_release(magic_api *api, int which,
|
|||
}
|
||||
|
||||
|
||||
void swirls_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void swirls_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)
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 r, Uint8 g,
|
||||
Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
swirl_fur_color_r = r;
|
||||
swirl_fur_color_g = g;
|
||||
|
|
@ -420,9 +421,10 @@ void swirls_switchin(magic_api *api ATTRIBUTE_UNUSED,
|
|||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas)
|
||||
{
|
||||
if (swirls_snapshot == NULL)
|
||||
swirls_snapshot = SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel, canvas->format->Rmask,
|
||||
canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
swirls_snapshot =
|
||||
SDL_CreateRGBSurface(SDL_SWSURFACE, canvas->w, canvas->h,
|
||||
canvas->format->BitsPerPixel,
|
||||
canvas->format->Rmask, canvas->format->Gmask, canvas->format->Bmask, canvas->format->Amask);
|
||||
|
||||
if (swirls_snapshot != NULL)
|
||||
SDL_BlitSurface(canvas, NULL, swirls_snapshot, NULL);
|
||||
|
|
@ -452,8 +454,10 @@ Uint8 swirls_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U
|
|||
return 0;
|
||||
}
|
||||
|
||||
void swirls_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,
|
||||
void swirls_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ void tessell_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int tessell_modes(magic_api * api, int which);
|
||||
Uint8 tessell_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 tessell_default_size(magic_api * api, int which, int mode);
|
||||
void tessell_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void tessell_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 tessell_api_version(void)
|
||||
|
|
@ -193,10 +193,11 @@ void tessell_click(magic_api *api, int which, int mode ATTRIBUTE_UNUSED,
|
|||
tessell_drag(api, which, canvas, last, x, y, x, y, update_rect);
|
||||
}
|
||||
|
||||
void tessell_release(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void tessell_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)
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED,
|
||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -206,8 +207,10 @@ void tessell_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(tessell_snd);
|
||||
}
|
||||
|
||||
void tessell_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,
|
||||
void tessell_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)
|
||||
{
|
||||
tessell_color = SDL_MapRGB(canvas->format, r, g, b);
|
||||
|
|
@ -260,8 +263,10 @@ Uint8 tessell_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 2;
|
||||
}
|
||||
|
||||
void tessell_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,
|
||||
void tessell_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)
|
||||
{
|
||||
tessell_radius = size;
|
||||
|
|
|
|||
|
|
@ -113,8 +113,8 @@ void tint_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
|||
int tint_modes(magic_api * api, int which);
|
||||
Uint8 tint_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 tint_default_size(magic_api * api, int which, int mode);
|
||||
void tint_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void tint_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 tint_api_version(void)
|
||||
|
|
@ -317,9 +317,11 @@ void tint_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void tint_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 tint_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)
|
||||
{
|
||||
tint_r = r;
|
||||
tint_g = g;
|
||||
|
|
@ -383,9 +385,10 @@ Uint8 tint_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
|
|||
return 4;
|
||||
}
|
||||
|
||||
void tint_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void tint_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tint_RADIUS = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,8 +105,8 @@ int toothpaste_modes(magic_api * api, int which);
|
|||
int toothpaste_setup_weights(magic_api * api);
|
||||
Uint8 toothpaste_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 toothpaste_default_size(magic_api * api, int which, int mode);
|
||||
void toothpaste_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void toothpaste_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 toothpaste_api_version(void)
|
||||
|
|
@ -291,9 +291,11 @@ void toothpaste_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void toothpaste_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 toothpaste_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)
|
||||
{
|
||||
toothpaste_r = r;
|
||||
toothpaste_g = g;
|
||||
|
|
@ -333,9 +335,10 @@ Uint8 toothpaste_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBU
|
|||
return 2;
|
||||
}
|
||||
|
||||
void toothpaste_set_size(magic_api *api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED, SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void toothpaste_set_size(magic_api *api, int which ATTRIBUTE_UNUSED,
|
||||
int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *last ATTRIBUTE_UNUSED, Uint8 size, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
toothpaste_RADIUS = size * 5;
|
||||
toothpaste_setup_weights(api);
|
||||
|
|
|
|||
|
|
@ -97,8 +97,8 @@ void tornado_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
int tornado_modes(magic_api * api, int which);
|
||||
Uint8 tornado_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 tornado_default_size(magic_api * api, int which, int mode);
|
||||
void tornado_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void tornado_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
|
||||
|
|
@ -448,9 +448,10 @@ void tornado_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void tornado_set_color(magic_api *api, 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 tornado_set_color(magic_api *api, 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)
|
||||
{
|
||||
tornado_r = r;
|
||||
tornado_g = g;
|
||||
|
|
@ -596,8 +597,10 @@ Uint8 tornado_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
|
|||
return 0;
|
||||
}
|
||||
|
||||
void tornado_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,
|
||||
void tornado_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,13 +178,12 @@ Uint8 trochoids_default_size(magic_api * api, int which, int mode);
|
|||
void trochoids_shutdown(magic_api * api);
|
||||
void trochoids_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void trochoids_drag(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot,
|
||||
int old_x, int old_y, int x, int y, SDL_Rect * update_rect);
|
||||
void trochoids_work(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect, int guides);
|
||||
void trochoids_release(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void trochoids_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int old_x, int old_y, int x, int y, SDL_Rect * update_rect);
|
||||
void trochoids_work(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect, int guides);
|
||||
void trochoids_release(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect);
|
||||
void trochoids_sound(magic_api * api, int snd_idx, int x, int y);
|
||||
void trochoids_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
|
|
@ -426,8 +425,8 @@ void trochoids_work(magic_api *api, int which,
|
|||
py2 = trochoids_y + (((R + r) * deg_sin((a2))) - (d * deg_sin(r_ratio * a2)));
|
||||
}
|
||||
|
||||
api->line((void *)api, which, canvas, snapshot, px, py, px2, py2, (20 * (guides && (a >= 360.0))) + 1,
|
||||
trochoids_line_callback);
|
||||
api->line((void *)api, which, canvas, snapshot, px, py, px2, py2,
|
||||
(20 * (guides && (a >= 360.0))) + 1, trochoids_line_callback);
|
||||
}
|
||||
|
||||
if (guides)
|
||||
|
|
@ -599,32 +598,36 @@ void trochoids_sound(magic_api *api, int snd_idx, int x, int y)
|
|||
}
|
||||
|
||||
|
||||
void trochoids_set_color(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void trochoids_set_color(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED,
|
||||
Uint8 r, Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, Uint8 r,
|
||||
Uint8 g, Uint8 b, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
trochoids_color = SDL_MapRGB(canvas->format, r, g, b);
|
||||
}
|
||||
|
||||
|
||||
void trochoids_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void trochoids_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
trochoids_size = (size - 1); /* array index is 0-based, but Tux Paint returns between 1...{accepted sizes} */
|
||||
}
|
||||
|
||||
|
||||
void trochoids_line_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
void trochoids_line_callback(void *pointer ATTRIBUTE_UNUSED,
|
||||
int tool ATTRIBUTE_UNUSED, SDL_Surface *canvas,
|
||||
SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
{
|
||||
magic_api *api = (magic_api *) pointer;
|
||||
|
||||
api->putpixel(canvas, x, y, trochoids_color);
|
||||
}
|
||||
|
||||
void trochoids_xorline_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBUTE_UNUSED,
|
||||
void trochoids_xorline_callback(void *pointer ATTRIBUTE_UNUSED,
|
||||
int tool ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas, SDL_Surface *snapshot ATTRIBUTE_UNUSED, int x, int y)
|
||||
{
|
||||
magic_api *api = (magic_api *) pointer;
|
||||
|
|
@ -635,13 +638,13 @@ void trochoids_xorline_callback(void *pointer ATTRIBUTE_UNUSED, int tool ATTRIBU
|
|||
api->xorpixel(canvas, x + 1, y + 1);
|
||||
}
|
||||
|
||||
void trochoids_switchin(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED)
|
||||
void trochoids_switchin(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
void trochoids_switchout(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface *canvas ATTRIBUTE_UNUSED)
|
||||
void trochoids_switchout(magic_api *api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface *canvas ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ void tv_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
|||
int tv_modes(magic_api * api, int which);
|
||||
Uint8 tv_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 tv_default_size(magic_api * api, int which, int mode);
|
||||
void tv_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void tv_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
// Housekeeping functions
|
||||
|
|
@ -86,8 +86,10 @@ Uint32 tv_api_version(void)
|
|||
return (TP_MAGIC_API_VERSION);
|
||||
}
|
||||
|
||||
void tv_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,
|
||||
void tv_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)
|
||||
{
|
||||
//get the colors from API and store it in structure
|
||||
|
|
@ -309,9 +311,10 @@ Uint8 tv_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE
|
|||
return 4;
|
||||
}
|
||||
|
||||
void tv_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,
|
||||
SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
void tv_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, SDL_Rect *update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tv_radius = size * 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ void waves_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
|||
int waves_modes(magic_api * api, int which);
|
||||
Uint8 waves_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 waves_default_size(magic_api * api, int which, int mode);
|
||||
void waves_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void waves_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
Uint32 waves_api_version(void)
|
||||
{
|
||||
|
|
@ -225,10 +225,12 @@ void waves_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
}
|
||||
|
||||
// Record the color from Tux Paint:
|
||||
void waves_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)
|
||||
void waves_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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -264,8 +266,10 @@ Uint8 waves_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UN
|
|||
return 0;
|
||||
}
|
||||
|
||||
void waves_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,
|
||||
void waves_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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ void xor_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas);
|
|||
int xor_modes(magic_api * api, int which);
|
||||
Uint8 xor_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 xor_default_size(magic_api * api, int which, int mode);
|
||||
void xor_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||
SDL_Rect * update_rect);
|
||||
void xor_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect);
|
||||
|
||||
|
||||
Uint32 xor_api_version(void)
|
||||
|
|
@ -218,8 +218,11 @@ void xor_shutdown(magic_api *api ATTRIBUTE_UNUSED)
|
|||
Mix_FreeChunk(xor_snd);
|
||||
}
|
||||
|
||||
void xor_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,
|
||||
void xor_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)
|
||||
{
|
||||
}
|
||||
|
|
@ -258,8 +261,10 @@ Uint8 xor_default_size(magic_api *api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS
|
|||
return 4;
|
||||
}
|
||||
|
||||
void xor_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,
|
||||
void xor_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)
|
||||
{
|
||||
xor_radius = size * 4;
|
||||
|
|
|
|||
|
|
@ -221,22 +221,21 @@ void loadfont_callback(SDL_Surface *screen, SDL_Texture *texture,
|
|||
// especially important for users who have scroll buttons disabled.
|
||||
// Translators should do whatever is needed to put crummy fonts last.
|
||||
|
||||
user_font_styles[num_font_styles]->score +=
|
||||
charset_works(font, /* distinct uppercase and lowercase (e.g., 'o' vs. 'O') */ gettext("oO")
|
||||
);
|
||||
user_font_styles[num_font_styles]->score += charset_works(font,
|
||||
/* distinct uppercase and lowercase (e.g., 'o' vs. 'O') */
|
||||
gettext("oO"));
|
||||
|
||||
// common punctuation (e.g., '?', '!', '.', ',', etc.)
|
||||
user_font_styles[num_font_styles]->score +=
|
||||
charset_works(font, /* common punctuation (e.g., '?', '!', '.', ',', etc.) */ gettext(",.?!")
|
||||
);
|
||||
user_font_styles[num_font_styles]->score += charset_works(font,
|
||||
/* common punctuation (e.g., '?', '!', '.', ',', etc.) */
|
||||
gettext(",.?!"));
|
||||
|
||||
user_font_styles[num_font_styles]->score +=
|
||||
charset_works(font, /* uncommon punctuation (e.g., '@', '#', '*', etc.) */ gettext("`\%_@$~#{<(^&*")
|
||||
);
|
||||
user_font_styles[num_font_styles]->score += charset_works(font,
|
||||
/* uncommon punctuation (e.g., '@', '#', '*', etc.) */
|
||||
gettext("`\%_@$~#{<(^&*"));
|
||||
|
||||
user_font_styles[num_font_styles]->score +=
|
||||
charset_works(font, /* digits (e.g., '0', '1' and '7') */ gettext("017")
|
||||
);
|
||||
user_font_styles[num_font_styles]->score += charset_works(font, /* digits (e.g., '0', '1' and '7') */
|
||||
gettext("017"));
|
||||
|
||||
user_font_styles[num_font_styles]->score += charset_works(font, /* distinct circle-like characters (e.g., 'O' (capital oh) vs. '0' (zero)) */
|
||||
gettext("O0"));
|
||||
|
|
|
|||
61
src/fonts.c
61
src/fonts.c
|
|
@ -56,10 +56,11 @@
|
|||
|
||||
/* Enums representing the "prefix" attributes Tux Paint understands
|
||||
in "fonts.conf" `<dir>` tags */
|
||||
enum {
|
||||
FC_PREFIX_NONE, /* if none, "default", or "cwd" */
|
||||
FC_PREFIX_XDG, /* if "xdg", use $XDG_DATA_HOME */
|
||||
FC_PREFIX_RELATIVE, /* if "relative", relative to the "fonts.conf" where the `<dir>` tag exists */
|
||||
enum
|
||||
{
|
||||
FC_PREFIX_NONE, /* if none, "default", or "cwd" */
|
||||
FC_PREFIX_XDG, /* if "xdg", use $XDG_DATA_HOME */
|
||||
FC_PREFIX_RELATIVE, /* if "relative", relative to the "fonts.conf" where the `<dir>` tag exists */
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -198,7 +199,8 @@ int button_label_y_nudge;
|
|||
|
||||
/* Local function prototypes: */
|
||||
|
||||
char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_mallocd);
|
||||
char **malloc_fontconfig_config_paths(int num_to_malloc, int *num_actually_mallocd);
|
||||
|
||||
#ifdef FORKED_FONTS
|
||||
static void reliable_read(int fd, void *buf, size_t count);
|
||||
#endif
|
||||
|
|
@ -1021,11 +1023,11 @@ static void loadfonts(SDL_Surface *screen, SDL_Texture *texture, SDL_Renderer *r
|
|||
* allocated; either the same value as num_to_malloc, or 0 if failure
|
||||
* @return char * * | NULL -- pointer to the char * array, or NULL if malloc failed
|
||||
*/
|
||||
char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_mallocd)
|
||||
char **malloc_fontconfig_config_paths(int num_to_malloc, int *num_actually_mallocd)
|
||||
{
|
||||
char * * buf;
|
||||
char **buf;
|
||||
|
||||
buf = (char * *) malloc(sizeof(char *) * num_to_malloc);
|
||||
buf = (char * *)malloc(sizeof(char *) * num_to_malloc);
|
||||
if (buf == NULL)
|
||||
*num_actually_mallocd = 0;
|
||||
else
|
||||
|
|
@ -1038,7 +1040,7 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
SDL_Renderer *renderer, void *vp, const char *restrict const locale)
|
||||
{
|
||||
char *homedirdir;
|
||||
char * * fontconfig_config_paths;
|
||||
char **fontconfig_config_paths;
|
||||
int num_fontconfig_config_paths = 0;
|
||||
int i;
|
||||
|
||||
|
|
@ -1055,7 +1057,8 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
|
||||
/* Windows: Look for fonts in the user font dir (as defined by Windows registry) */
|
||||
homedirdir = GetUserFontDir();
|
||||
if (homedirdir != NULL){
|
||||
if (homedirdir != NULL)
|
||||
{
|
||||
loadfonts(screen, texture, renderer, homedirdir);
|
||||
}
|
||||
free(homedirdir);
|
||||
|
|
@ -1131,14 +1134,16 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
snprintf(fontconfig_config_paths[0], 1024, "/boot/system/settings/fonts/fonts.conf");
|
||||
}
|
||||
#elif defined(WIN32)
|
||||
fontconfig_config_paths = malloc_fontconfig_config_paths(1 /* FIXME */, &num_fontconfig_config_paths);
|
||||
fontconfig_config_paths = malloc_fontconfig_config_paths(1 /* FIXME */ ,
|
||||
&num_fontconfig_config_paths);
|
||||
if (fontconfig_config_paths != NULL)
|
||||
{
|
||||
/* FIXME: Windows: Look for fonts.conf ??? in some system directory/ies ??? */
|
||||
|
||||
/* Windows: Look for the fonts.conf that we ship with Tux Paint for Windows */
|
||||
fontconfig_config_paths[0 /* FIXME */] = malloc(1024);
|
||||
snprintf(fontconfig_config_paths[0 /* FIXME */], 1024, "etc/fonts/fonts.conf");
|
||||
fontconfig_config_paths[0 /* FIXME */ ] = malloc(1024);
|
||||
snprintf(fontconfig_config_paths[0 /* FIXME */ ], 1024,
|
||||
"etc/fonts/fonts.conf");
|
||||
}
|
||||
#else
|
||||
/* Others [e.g. Linux]: Look for fonts.conf in $FONTCONFIG_PATH (fallback to "/etc/fonts")
|
||||
|
|
@ -1146,7 +1151,7 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
fontconfig_config_paths = malloc_fontconfig_config_paths(2, &num_fontconfig_config_paths);
|
||||
if (fontconfig_config_paths != NULL)
|
||||
{
|
||||
char * config_home;
|
||||
char *config_home;
|
||||
|
||||
/* System-wide fonts.conf */
|
||||
if (getenv("FONTCONFIG_PATH") != NULL)
|
||||
|
|
@ -1216,11 +1221,12 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
cur = xmlDocGetRootElement(doc);
|
||||
if (cur == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: Failed to parse empty fontconfig configuration file '%s'\n", fontconfig_config_paths[i]);
|
||||
fprintf(stderr,
|
||||
"Error: Failed to parse empty fontconfig configuration file '%s'\n", fontconfig_config_paths[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xmlStrcmp(cur->name, (const xmlChar *) "fontconfig"))
|
||||
if (xmlStrcmp(cur->name, (const xmlChar *)"fontconfig"))
|
||||
{
|
||||
fprintf(stderr, "Error: Not a fontconfig configuration file: '%s'\n", fontconfig_config_paths[i]);
|
||||
}
|
||||
|
|
@ -1229,21 +1235,21 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
cur = cur->xmlChildrenNode;
|
||||
while (cur != NULL)
|
||||
{
|
||||
if (xmlStrcmp(cur->name, (const xmlChar *) "dir") == 0)
|
||||
if (xmlStrcmp(cur->name, (const xmlChar *)"dir") == 0)
|
||||
{
|
||||
xmlChar * path, * prefix;
|
||||
char * path_str;
|
||||
xmlChar *path, *prefix;
|
||||
char *path_str;
|
||||
char prefix_path[1024];
|
||||
int fontconfig_prefix = FC_PREFIX_NONE;
|
||||
|
||||
/* Check for a "<dir prefix...>" attribute
|
||||
(see https://www.freedesktop.org/software/fontconfig/fontconfig-user.html) */
|
||||
prefix = xmlGetProp(cur, (const xmlChar *) "prefix");
|
||||
prefix = xmlGetProp(cur, (const xmlChar *)"prefix");
|
||||
if (prefix != NULL)
|
||||
{
|
||||
if (xmlStrcmp(prefix, (const xmlChar *) "xdg") == 0)
|
||||
if (xmlStrcmp(prefix, (const xmlChar *)"xdg") == 0)
|
||||
fontconfig_prefix = FC_PREFIX_XDG;
|
||||
else if (xmlStrcmp(prefix, (const xmlChar *) "relative") == 0)
|
||||
else if (xmlStrcmp(prefix, (const xmlChar *)"relative") == 0)
|
||||
fontconfig_prefix = FC_PREFIX_RELATIVE;
|
||||
|
||||
xmlFree(prefix);
|
||||
|
|
@ -1257,7 +1263,8 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
path = xmlNodeGetContent(cur);
|
||||
if (path != NULL)
|
||||
{
|
||||
path_str = strdup((char *) path /* FIXME: is this cast safe? -bjk 2024.12.29 */);
|
||||
path_str = strdup((char *)path
|
||||
/* FIXME: is this cast safe? -bjk 2024.12.29 */ );
|
||||
#ifdef __linux__
|
||||
#ifndef __ANDROID__
|
||||
wordexp_t result;
|
||||
|
|
@ -1310,16 +1317,16 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
referred to by path should not be modified or
|
||||
freed until the pointer returned by the function
|
||||
is no longer required.
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
if (prefix_path[0] != '\0')
|
||||
{
|
||||
char * tmp_str;
|
||||
char *tmp_str;
|
||||
size_t len;
|
||||
|
||||
len = strlen(path_str) + strlen(prefix_path) + 1;
|
||||
tmp_str = (char *) malloc(sizeof(char *) * len);
|
||||
tmp_str = (char *)malloc(sizeof(char *) * len);
|
||||
if (tmp_str != NULL)
|
||||
{
|
||||
snprintf(tmp_str, len, "%s%s", prefix_path, path_str);
|
||||
|
|
@ -1329,7 +1336,7 @@ char * * malloc_fontconfig_config_paths(int num_to_malloc, int * num_actually_ma
|
|||
}
|
||||
|
||||
/* Try to load fonts from the location found in the fonts.conf's <dir> tag */
|
||||
loadfonts(screen, texture, renderer, (char *) path_str);
|
||||
loadfonts(screen, texture, renderer, (char *)path_str);
|
||||
free(path_str);
|
||||
xmlFree(path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ struct osk_keyboard *osk_create(char *layout_name, SDL_Surface *canvas,
|
|||
SDL_Surface *BLANK_oskdel,
|
||||
SDL_Surface *BLANK_osktab,
|
||||
SDL_Surface *BLANK_oskenter,
|
||||
SDL_Surface *BLANK_oskcapslock, SDL_Surface *BLANK_oskshift,
|
||||
SDL_Surface *BLANK_oskpaste, int disable_change)
|
||||
SDL_Surface *BLANK_oskcapslock,
|
||||
SDL_Surface *BLANK_oskshift, SDL_Surface *BLANK_oskpaste, int disable_change)
|
||||
{
|
||||
SDL_Surface *surface;
|
||||
SDL_Surface *button_up, *button_down;
|
||||
|
|
@ -1821,8 +1821,7 @@ struct osk_keyboard *osk_clicked(on_screen_keyboard *keyboard, int x, int y)
|
|||
keyboard->BLANK_button_hold,
|
||||
keyboard->BLANK_oskdel, keyboard->BLANK_osktab,
|
||||
keyboard->BLANK_oskenter, keyboard->BLANK_oskcapslock,
|
||||
keyboard->BLANK_oskshift, keyboard->BLANK_oskshift,
|
||||
keyboard->disable_change);
|
||||
keyboard->BLANK_oskshift, keyboard->BLANK_oskshift, keyboard->disable_change);
|
||||
|
||||
free(aux_list_ptr);
|
||||
|
||||
|
|
@ -1900,7 +1899,7 @@ struct osk_keyboard *osk_clicked(on_screen_keyboard *keyboard, int x, int y)
|
|||
else if (wcsncmp(L"XF86Paste", ks, 9) == 0)
|
||||
{
|
||||
event.key.keysym.sym = SDLK_PASTE;
|
||||
event.text.text[0] = '\0'; // FIXME: Is this okay? -bjk 2024.12.25
|
||||
event.text.text[0] = '\0'; // FIXME: Is this okay? -bjk 2024.12.25
|
||||
}
|
||||
else if (wcsncmp(L"NoSymbol", ks, 8) == 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -163,8 +163,8 @@ struct osk_keyboard *osk_create(char *layout_name, SDL_Surface * canvas,
|
|||
SDL_Surface * BLANK_oskdel,
|
||||
SDL_Surface * BLANK_osktab,
|
||||
SDL_Surface * BLANK_oskenter,
|
||||
SDL_Surface * BLANK_oskcapslock, SDL_Surface * BLANK_oskshift,
|
||||
SDL_Surface * BLANK_oskpaste, int disable_change);
|
||||
SDL_Surface * BLANK_oskcapslock,
|
||||
SDL_Surface * BLANK_oskshift, SDL_Surface * BLANK_oskpaste, int disable_change);
|
||||
|
||||
struct osk_layout *osk_load_layout(char *layout_name);
|
||||
|
||||
|
|
|
|||
299
src/tuxpaint.c
299
src/tuxpaint.c
|
|
@ -863,8 +863,8 @@ static void set_max_buttonscale(void)
|
|||
max_h = (float)WINDOW_HEIGHT / (40 + (6 * 48) + (gd_colors.rows * 48) + 56);
|
||||
|
||||
button_scale = min(max_w, max_h);
|
||||
fprintf(stderr, "Info: Will use a button size of %d (scale = %f)\n", (int)(button_scale * ORIGINAL_BUTTON_SIZE),
|
||||
button_scale);
|
||||
fprintf(stderr, "Info: Will use a button size of %d (scale = %f)\n",
|
||||
(int)(button_scale * ORIGINAL_BUTTON_SIZE), button_scale);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1213,8 +1213,8 @@ static int grid_hit_gd(const SDL_Rect *const r, unsigned x, unsigned y, grid_dim
|
|||
unsigned col = (x - r->x) / item_w;
|
||||
unsigned row = (y - r->y) / item_h;
|
||||
|
||||
DEBUG_PRINTF("%d,%d resolves to %d,%d in a %dx%d grid, index is %d\n", x, y, col,
|
||||
row, gd->cols, gd->rows, col + row * gd->cols);
|
||||
DEBUG_PRINTF("%d,%d resolves to %d,%d in a %dx%d grid, index is %d\n", x, y,
|
||||
col, row, gd->cols, gd->rows, col + row * gd->cols);
|
||||
if (col >= gd->cols || row >= gd->rows)
|
||||
return -1;
|
||||
return col + row * gd->cols;
|
||||
|
|
@ -1948,8 +1948,9 @@ static Uint8 *brushes_descr_localized = NULL;
|
|||
static SDL_Surface *img_shapes[NUM_SHAPES], *img_shape_names[NUM_SHAPES];
|
||||
static SDL_Surface *img_fills[NUM_FILLS], *img_fill_names[NUM_FILLS];
|
||||
static SDL_Surface *img_openlabels_open, *img_openlabels_erase,
|
||||
*img_openlabels_slideshow, *img_openlabels_back, *img_openlabels_play, *img_openlabels_template,
|
||||
*img_openlabels_gif_export, *img_openlabels_pict_export, *img_openlabels_next, *img_mixerlabel_clear;
|
||||
*img_openlabels_slideshow, *img_openlabels_back, *img_openlabels_play,
|
||||
*img_openlabels_template, *img_openlabels_gif_export,
|
||||
*img_openlabels_pict_export, *img_openlabels_next, *img_mixerlabel_clear;
|
||||
|
||||
static SDL_Surface *img_tux[NUM_TIP_TUX];
|
||||
|
||||
|
|
@ -2225,8 +2226,8 @@ static int do_slideshow(void);
|
|||
static void play_slideshow(int *selected, int num_selected, char *dirname, char **d_names, char **d_exts, int speed);
|
||||
static void draw_selection_digits(int right, int bottom, int n);
|
||||
|
||||
static int export_gif(int *selected, int num_selected, char *dirname, char **d_names, char **d_exts, int speed,
|
||||
char **dest_fname);
|
||||
static int export_gif(int *selected, int num_selected, char *dirname,
|
||||
char **d_names, char **d_exts, int speed, char **dest_fname);
|
||||
int export_gif_monitor_events(void);
|
||||
|
||||
/* Locations where export_pict() can save */
|
||||
|
|
@ -2886,7 +2887,8 @@ static void mainloop(void)
|
|||
magic_switchin(canvas);
|
||||
}
|
||||
#endif
|
||||
else if (key == SDLK_z && (mod & KMOD_CTRL) && !noshortcuts && !button_down && !emulate_button_pressed
|
||||
else if (key == SDLK_z && (mod & KMOD_CTRL) && !noshortcuts
|
||||
&& !button_down && !emulate_button_pressed
|
||||
&& stamp_tool_mode != STAMP_TOOL_MODE_ROTATE && shape_tool_mode != SHAPE_TOOL_MODE_ROTATE)
|
||||
{
|
||||
/* Ctrl-Z - Undo */
|
||||
|
|
@ -3160,12 +3162,12 @@ static void mainloop(void)
|
|||
/* Ctrl-V - Paste */
|
||||
if (cur_tool == TOOL_TEXT || cur_tool == TOOL_LABEL)
|
||||
{
|
||||
char * pasted_txt;
|
||||
char *pasted_txt;
|
||||
|
||||
if (SDL_HasClipboardText())
|
||||
{
|
||||
pasted_txt = SDL_GetClipboardText();
|
||||
if (pasted_txt != NULL /* it shouldn't be */)
|
||||
if (pasted_txt != NULL /* it shouldn't be */ )
|
||||
{
|
||||
if (pasted_txt[0] != '\0')
|
||||
{
|
||||
|
|
@ -3181,7 +3183,7 @@ static void mainloop(void)
|
|||
{
|
||||
int exceeded;
|
||||
|
||||
mbstowcs(tmp, pasted_txt, n); /* at most n wchar_t written */
|
||||
mbstowcs(tmp, pasted_txt, n); /* at most n wchar_t written */
|
||||
exceeded = 0;
|
||||
for (int i = 0; tmp[i] != '\0' && !exceeded; i++)
|
||||
{
|
||||
|
|
@ -3202,15 +3204,20 @@ static void mainloop(void)
|
|||
|
||||
best = -1;
|
||||
|
||||
for (j = texttool_len - 1; j >= 0 && best == -1; j--) {
|
||||
if (texttool_str[j] == ' ') {
|
||||
best = j + 1; /* +1 to eat the space */
|
||||
} else if (texttool_str[j] == '-') { /* FIXME: Also en-dash, em-dash, others? -bjk 2024.12.25 */
|
||||
for (j = texttool_len - 1; j >= 0 && best == -1; j--)
|
||||
{
|
||||
if (texttool_str[j] == ' ')
|
||||
{
|
||||
best = j + 1; /* +1 to eat the space */
|
||||
}
|
||||
else if (texttool_str[j] == '-')
|
||||
{ /* FIXME: Also en-dash, em-dash, others? -bjk 2024.12.25 */
|
||||
best = j;
|
||||
}
|
||||
}
|
||||
|
||||
if (best == -1) {
|
||||
if (best == -1)
|
||||
{
|
||||
best = texttool_len - 1;
|
||||
}
|
||||
|
||||
|
|
@ -3735,16 +3742,14 @@ static void mainloop(void)
|
|||
img_btn_up, img_btn_down, img_btn_off,
|
||||
img_btn_nav, img_btn_hold,
|
||||
img_oskdel, img_osktab, img_oskenter,
|
||||
img_oskcapslock, img_oskshift, img_oskpaste,
|
||||
onscreen_keyboard_disable_change);
|
||||
img_oskcapslock, img_oskshift, img_oskpaste, onscreen_keyboard_disable_change);
|
||||
else
|
||||
kbd =
|
||||
osk_create(strdup("default.layout"), canvas,
|
||||
img_btn_up, img_btn_down, img_btn_off,
|
||||
img_btn_nav, img_btn_hold,
|
||||
img_oskdel, img_osktab, img_oskenter,
|
||||
img_oskcapslock, img_oskshift, img_oskpaste,
|
||||
onscreen_keyboard_disable_change);
|
||||
img_oskcapslock, img_oskshift, img_oskpaste, onscreen_keyboard_disable_change);
|
||||
}
|
||||
|
||||
if (kbd == NULL)
|
||||
|
|
@ -4491,10 +4496,12 @@ static void mainloop(void)
|
|||
|
||||
if (magics[grp][cur].sizes[magic_modeint(magics[grp][cur].mode)])
|
||||
{
|
||||
DEBUG_PRINTF("group %d thing %d in mode %04x (%d) has %d sizes; size is %d\n", grp, cur,
|
||||
magics[grp][cur].mode, magic_modeint(magics[grp][cur].mode),
|
||||
magics[grp][cur].sizes[magic_modeint(magics[grp][cur].mode)],
|
||||
magics[grp][cur].size[magic_modeint(magics[grp][cur].mode)]);
|
||||
DEBUG_PRINTF
|
||||
("group %d thing %d in mode %04x (%d) has %d sizes; size is %d\n",
|
||||
grp, cur, magics[grp][cur].mode,
|
||||
magic_modeint(magics[grp][cur].mode),
|
||||
magics[grp][cur].sizes[magic_modeint(magics[grp][cur].mode)],
|
||||
magics[grp][cur].size[magic_modeint(magics[grp][cur].mode)]);
|
||||
magic_set_size();
|
||||
}
|
||||
}
|
||||
|
|
@ -4511,8 +4518,8 @@ static void mainloop(void)
|
|||
old_size = magics[grp][cur].size[mode];
|
||||
|
||||
new_size =
|
||||
((magics[grp][cur].sizes[mode] * (event.button.x - (WINDOW_WIDTH - r_ttoolopt.w))) /
|
||||
r_ttoolopt.w) + 1;
|
||||
((magics[grp][cur].sizes[mode] *
|
||||
(event.button.x - (WINDOW_WIDTH - r_ttoolopt.w))) / r_ttoolopt.w) + 1;
|
||||
|
||||
if (new_size != old_size)
|
||||
{
|
||||
|
|
@ -4863,8 +4870,8 @@ static void mainloop(void)
|
|||
if (prev_new_size < brushes_spacing_default[cur_brush] &&
|
||||
next_new_size > brushes_spacing_default[cur_brush])
|
||||
{
|
||||
DEBUG_PRINTF("Nudging %d brush spacing to my default: %d\n", new_size,
|
||||
brushes_spacing_default[cur_brush]);
|
||||
DEBUG_PRINTF
|
||||
("Nudging %d brush spacing to my default: %d\n", new_size, brushes_spacing_default[cur_brush]);
|
||||
new_size = brushes_spacing_default[cur_brush];
|
||||
}
|
||||
}
|
||||
|
|
@ -5044,7 +5051,8 @@ static void mainloop(void)
|
|||
else
|
||||
fmt_str = TIP_LABEL_FONTCHANGE;
|
||||
|
||||
safe_snprintf(font_tux_text, sizeof(font_tux_text), gettext(fmt_str),
|
||||
safe_snprintf(font_tux_text, sizeof(font_tux_text),
|
||||
gettext(fmt_str),
|
||||
TTF_FontFaceFamilyName(getfonthandle(cur_font)->ttf_font),
|
||||
TTF_FontFaceStyleName(getfonthandle(cur_font)->ttf_font), getfonthandle(cur_font)->height);
|
||||
draw_tux_text(TUX_GREAT, font_tux_text, 1);
|
||||
|
|
@ -5357,9 +5365,10 @@ static void mainloop(void)
|
|||
(as long as we're not involved in anything else within
|
||||
this main loop!) */
|
||||
|
||||
if ((cur_tool != TOOL_SHAPES || shape_mode == SHAPE_TOOL_MODE_DONE) &&
|
||||
(cur_tool != TOOL_STAMP || stamp_tool_mode == STAMP_TOOL_MODE_PLACE) &&
|
||||
cur_tool != TOOL_TEXT && cur_tool != TOOL_LABEL)
|
||||
if ((cur_tool != TOOL_SHAPES
|
||||
|| shape_mode == SHAPE_TOOL_MODE_DONE)
|
||||
&& (cur_tool != TOOL_STAMP
|
||||
|| stamp_tool_mode == STAMP_TOOL_MODE_PLACE) && cur_tool != TOOL_TEXT && cur_tool != TOOL_LABEL)
|
||||
{
|
||||
/* Jump into quick eraser loop */
|
||||
do_quick_eraser();
|
||||
|
|
@ -5570,8 +5579,8 @@ static void mainloop(void)
|
|||
else
|
||||
{
|
||||
draw_color = SDL_MapRGB(canvas->format,
|
||||
color_hexes[cur_color][0], color_hexes[cur_color][1],
|
||||
color_hexes[cur_color][2]);
|
||||
color_hexes[cur_color][0],
|
||||
color_hexes[cur_color][1], color_hexes[cur_color][2]);
|
||||
}
|
||||
|
||||
would_fill = would_flood_fill(canvas, draw_color, canv_color);
|
||||
|
|
@ -6284,8 +6293,8 @@ static void mainloop(void)
|
|||
shape_current_x)
|
||||
+ (shape_start_y - shape_current_y) * (shape_start_y - shape_current_y));
|
||||
|
||||
SDL_WarpMouse(shape_ctr_x + (shape_current_x - shape_ctr_x) * 1.05 + r_canvas.x,
|
||||
shape_ctr_y + r_canvas.y);
|
||||
SDL_WarpMouse(shape_ctr_x +
|
||||
(shape_current_x - shape_ctr_x) * 1.05 + r_canvas.x, shape_ctr_y + r_canvas.y);
|
||||
do_setcursor(cursor_rotate);
|
||||
|
||||
|
||||
|
|
@ -6769,9 +6778,9 @@ static void mainloop(void)
|
|||
|
||||
magic_funcs[magics[magic_group]
|
||||
[cur_magic[magic_group]].handle_idx].drag(magic_api_struct,
|
||||
magics[magic_group][cur_magic
|
||||
[magic_group]].idx, canvas, last,
|
||||
old_x, old_y, new_x, new_y, &update_rect);
|
||||
magics[magic_group][cur_magic[magic_group]].idx,
|
||||
canvas, last, old_x, old_y, new_x, new_y,
|
||||
&update_rect);
|
||||
|
||||
update_canvas(update_rect.x, update_rect.y, update_rect.x + update_rect.w, update_rect.y + update_rect.h);
|
||||
}
|
||||
|
|
@ -6916,9 +6925,13 @@ static void mainloop(void)
|
|||
/* The half of maximum size the stamp could have when rotating. */
|
||||
int half_bigbox =
|
||||
sqrt((CUR_STAMP_W + 1) * (CUR_STAMP_W + 1) + (CUR_STAMP_H + 1) * (CUR_STAMP_H + 1)) / 2;
|
||||
update_screen(min(min(new_x, old_x), stamp_place_x - half_bigbox) + r_canvas.x,
|
||||
min(min(new_y, old_y), stamp_place_y - half_bigbox) + r_canvas.y,
|
||||
max(max(new_x, old_x), stamp_place_x + half_bigbox) + r_canvas.x,
|
||||
update_screen(min
|
||||
(min(new_x, old_x),
|
||||
stamp_place_x - half_bigbox) + r_canvas.x,
|
||||
min(min(new_y, old_y),
|
||||
stamp_place_y - half_bigbox) + r_canvas.y,
|
||||
max(max(new_x, old_x),
|
||||
stamp_place_x + half_bigbox) + r_canvas.x,
|
||||
max(max(new_y, old_y), stamp_place_y + half_bigbox) + r_canvas.y);
|
||||
#else
|
||||
/* FIXME: Be smarter about this */
|
||||
|
|
@ -7018,8 +7031,8 @@ static void mainloop(void)
|
|||
r_ttoolopt.w))) / r_toolopt.w) +
|
||||
MIN_STAMP_SIZE;
|
||||
|
||||
DEBUG_PRINTF("Old size = %d, Chose %0.4f, New size =%d\n", old_size, choice,
|
||||
stamp_data[stamp_group][cur_stamp[stamp_group]]->size);
|
||||
DEBUG_PRINTF("Old size = %d, Chose %0.4f, New size =%d\n",
|
||||
old_size, choice, stamp_data[stamp_group][cur_stamp[stamp_group]]->size);
|
||||
|
||||
if (stamp_data[stamp_group][cur_stamp[stamp_group]]->size != old_size)
|
||||
{
|
||||
|
|
@ -7444,8 +7457,8 @@ static void blit_brush(int x, int y, int direction, double rotation, int *w, int
|
|||
/* Ensure any semi-transparent areas or edges match the same color as we're painting
|
||||
(and not cause a black halo; see https://sourceforge.net/p/tuxpaint/bugs/259/ -bjk 2024.10.11) */
|
||||
SDL_FillRect(brush_frame_surf, NULL,
|
||||
SDL_MapRGBA(brush_frame_surf->format, color_hexes[cur_color][0], color_hexes[cur_color][1],
|
||||
color_hexes[cur_color][2], 0));
|
||||
SDL_MapRGBA(brush_frame_surf->format,
|
||||
color_hexes[cur_color][0], color_hexes[cur_color][1], color_hexes[cur_color][2], 0));
|
||||
|
||||
/* 2021/09/28 SDL(2)_gfxBlitRGBA() is not available in the SDL2_gfx library, using plain SDL_BlitSurface() instead. Pere
|
||||
SDL_gfxBlitRGBA(img_cur_brush, &src, brush_frame_surf, NULL); */
|
||||
|
|
@ -8340,7 +8353,8 @@ void show_fonts(void)
|
|||
fprintf(stderr, "Unable to add font dir %s\n", locale_fontdir);
|
||||
}
|
||||
|
||||
FcDirCacheRead((const FcChar8 *)locale_fontdir, FcTrue /* force */ , FcConfigGetCurrent());
|
||||
FcDirCacheRead((const FcChar8 *)locale_fontdir, FcTrue /* force */ ,
|
||||
FcConfigGetCurrent());
|
||||
FcDirCacheRescan((const FcChar8 *)locale_fontdir, FcConfigGetCurrent());
|
||||
|
||||
generate_fontconfig_cache_real();
|
||||
|
|
@ -8417,7 +8431,8 @@ static unsigned compute_default_scale_factor(double ratio)
|
|||
*/
|
||||
static void loadbrush_callback(SDL_Surface *screen,
|
||||
__attribute__((unused)) SDL_Texture *texture,
|
||||
__attribute__((unused)) SDL_Renderer *renderer, const char *restrict const dir,
|
||||
__attribute__((unused)) SDL_Renderer *renderer,
|
||||
const char *restrict const dir,
|
||||
unsigned dirlen, tp_ftw_str *files, unsigned i, const char *restrict const locale)
|
||||
{
|
||||
FILE *fi;
|
||||
|
|
@ -8460,8 +8475,9 @@ static void loadbrush_callback(SDL_Surface *screen,
|
|||
|
||||
/* Load brush description, if any: */
|
||||
brushes_descr[num_brushes] = loaddesc(fname, &(brushes_descr_localized[num_brushes]));
|
||||
DEBUG_PRINTF("%s: %s (%d)\n", fname, (brushes_descr[num_brushes] != NULL ? brushes_descr[num_brushes] : "NULL"),
|
||||
brushes_descr_localized[num_brushes]);
|
||||
DEBUG_PRINTF("%s: %s (%d)\n", fname,
|
||||
(brushes_descr[num_brushes] !=
|
||||
NULL ? brushes_descr[num_brushes] : "NULL"), brushes_descr_localized[num_brushes]);
|
||||
|
||||
/* Load brush metadata, if any: */
|
||||
|
||||
|
|
@ -9330,7 +9346,8 @@ static void get_stamp_thumb(stamp_type *sd, int process_sound)
|
|||
*/
|
||||
static void loadstamp_callback(SDL_Surface *screen,
|
||||
__attribute__((unused)) SDL_Texture *texture,
|
||||
__attribute__((unused)) SDL_Renderer *renderer, const char *restrict const dir,
|
||||
__attribute__((unused)) SDL_Renderer *renderer,
|
||||
const char *restrict const dir,
|
||||
unsigned dirlen, tp_ftw_str *files, unsigned i, const char *restrict const locale)
|
||||
{
|
||||
(void)locale;
|
||||
|
|
@ -10460,8 +10477,9 @@ static void draw_magic(void)
|
|||
// (r_ttoolopt.h +
|
||||
// ((most / gd_toolopt.cols +
|
||||
// (TOOLOFFSET + 2) / gd_toolopt.cols) * button_h) + (button_h - img_magic_paint->h) / 2);
|
||||
dest.y = (button_h * buttons_tall + r_ttools.h) - button_h * (disable_magic_sizes ? 1 : 2) +
|
||||
((button_h - img_magic_paint->h) / 2);
|
||||
dest.y =
|
||||
(button_h * buttons_tall + r_ttools.h) -
|
||||
button_h * (disable_magic_sizes ? 1 : 2) + ((button_h - img_magic_paint->h) / 2);
|
||||
|
||||
SDL_BlitSurface(img_magic_paint, NULL, screen, &dest);
|
||||
|
||||
|
|
@ -10486,8 +10504,9 @@ static void draw_magic(void)
|
|||
// (r_ttoolopt.h +
|
||||
// ((most / gd_toolopt.cols +
|
||||
// (TOOLOFFSET + 2) / gd_toolopt.cols) * button_h) + (button_h - img_magic_fullscreen->h) / 2);
|
||||
dest.y = (button_h * buttons_tall + r_ttools.h) - button_h * (disable_magic_sizes ? 1 : 2) +
|
||||
((button_h - img_magic_fullscreen->h) / 2);
|
||||
dest.y =
|
||||
(button_h * buttons_tall + r_ttools.h) -
|
||||
button_h * (disable_magic_sizes ? 1 : 2) + ((button_h - img_magic_fullscreen->h) / 2);
|
||||
|
||||
SDL_BlitSurface(img_magic_fullscreen, NULL, screen, &dest);
|
||||
}
|
||||
|
|
@ -12763,8 +12782,8 @@ static void do_eraser(int x, int y, int update)
|
|||
if (sq <= sz / 2)
|
||||
{
|
||||
if (img_starter_bkgd != NULL)
|
||||
SDL_GetRGB(getpixel_bkgd(img_starter_bkgd, x + xx, y + yy), img_starter_bkgd->format, &r_erase, &g_erase,
|
||||
&b_erase);
|
||||
SDL_GetRGB(getpixel_bkgd(img_starter_bkgd, x + xx, y + yy),
|
||||
img_starter_bkgd->format, &r_erase, &g_erase, &b_erase);
|
||||
|
||||
if (eraser_type == ERASER_TYPE_CIRCLE_FUZZY)
|
||||
{
|
||||
|
|
@ -12777,8 +12796,8 @@ static void do_eraser(int x, int y, int update)
|
|||
else
|
||||
{
|
||||
/* Transparent */
|
||||
SDL_GetRGB(getpixels[last->format->BytesPerPixel] (last, x + xx, y + yy),
|
||||
last->format, &r_canvas, &g_canvas, &b_canvas);
|
||||
SDL_GetRGB(getpixels[last->format->BytesPerPixel]
|
||||
(last, x + xx, y + yy), last->format, &r_canvas, &g_canvas, &b_canvas);
|
||||
|
||||
canvas_pct = 0.75;
|
||||
erase_pct = 0.25;
|
||||
|
|
@ -13844,10 +13863,15 @@ static void autoscale_copy_smear_free(SDL_Surface *src, SDL_Surface *dst,
|
|||
* @param int SDCALL(*blit) -- function for blitting; "NondefectiveBlit" or "SDL_BlitSurface"
|
||||
* @param starter_template_options_t opts -- options (loaded from ".dat" file) describing strategies to take
|
||||
*/
|
||||
static void autoscale_copy_scale_or_smear_free(SDL_Surface *src, SDL_Surface *dst,
|
||||
int SDLCALL(*blit) (SDL_Surface *src,
|
||||
const SDL_Rect *srcrect,
|
||||
SDL_Surface *dst,
|
||||
static void autoscale_copy_scale_or_smear_free(SDL_Surface *src,
|
||||
SDL_Surface *dst,
|
||||
int SDLCALL(*blit) (SDL_Surface
|
||||
*src,
|
||||
const
|
||||
SDL_Rect
|
||||
*srcrect,
|
||||
SDL_Surface
|
||||
*dst,
|
||||
SDL_Rect *dstrect), starter_template_options_t opts)
|
||||
{
|
||||
int new_w, new_h;
|
||||
|
|
@ -13861,8 +13885,9 @@ static void autoscale_copy_scale_or_smear_free(SDL_Surface *src, SDL_Surface *ds
|
|||
|
||||
if (src_aspect > dst_aspect)
|
||||
{
|
||||
DEBUG_PRINTF("Image (%d x %d) is of a wider aspect (%0.5f) than canvas (%d x %d) (%0.5f)\n", src->w, src->h,
|
||||
src_aspect, dst->w, dst->h, dst_aspect);
|
||||
DEBUG_PRINTF
|
||||
("Image (%d x %d) is of a wider aspect (%0.5f) than canvas (%d x %d) (%0.5f)\n",
|
||||
src->w, src->h, src_aspect, dst->w, dst->h, dst_aspect);
|
||||
if (opts.scale_mode == STARTER_TEMPLATE_SCALE_MODE_HORIZ || opts.scale_mode == STARTER_TEMPLATE_SCALE_MODE_BOTH)
|
||||
{
|
||||
new_h = dst->h;
|
||||
|
|
@ -13872,8 +13897,9 @@ static void autoscale_copy_scale_or_smear_free(SDL_Surface *src, SDL_Surface *ds
|
|||
}
|
||||
else if (src_aspect < dst_aspect)
|
||||
{
|
||||
DEBUG_PRINTF("Image (%d x %d) is of a taller aspect (%0.5f) than canvas (%d x %d) (%0.5f)\n", src->w, src->h,
|
||||
src_aspect, dst->w, dst->h, dst_aspect);
|
||||
DEBUG_PRINTF
|
||||
("Image (%d x %d) is of a taller aspect (%0.5f) than canvas (%d x %d) (%0.5f)\n",
|
||||
src->w, src->h, src_aspect, dst->w, dst->h, dst_aspect);
|
||||
if (opts.scale_mode == STARTER_TEMPLATE_SCALE_MODE_VERT || opts.scale_mode == STARTER_TEMPLATE_SCALE_MODE_BOTH)
|
||||
{
|
||||
new_w = dst->w;
|
||||
|
|
@ -13883,8 +13909,8 @@ static void autoscale_copy_scale_or_smear_free(SDL_Surface *src, SDL_Surface *ds
|
|||
}
|
||||
else
|
||||
{
|
||||
DEBUG_PRINTF("Image (%d x %d) is the same aspect as canvas (%d x %d) (%0.05f)\n", src->w, src->h, dst->w, dst->h,
|
||||
src_aspect);
|
||||
DEBUG_PRINTF
|
||||
("Image (%d x %d) is the same aspect as canvas (%d x %d) (%0.05f)\n", src->w, src->h, dst->w, dst->h, src_aspect);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -13898,7 +13924,8 @@ static void autoscale_copy_scale_or_smear_free(SDL_Surface *src, SDL_Surface *ds
|
|||
|
||||
DEBUG_PRINTF("Scaling from %d x %d to %d x %d\n", src->w, src->h, new_w, new_h);
|
||||
|
||||
scaled = thumbnail2(src, new_w, new_h, 0 /* keep aspect */ , 1 /* keep alpha */ );
|
||||
scaled = thumbnail2(src, new_w, new_h, 0 /* keep aspect */ ,
|
||||
1 /* keep alpha */ );
|
||||
if (scaled == NULL)
|
||||
{
|
||||
fprintf(stderr, "Failed to scale an image!\n");
|
||||
|
|
@ -13948,8 +13975,9 @@ static void autoscale_copy_scale_or_smear_free(SDL_Surface *src, SDL_Surface *ds
|
|||
src_rect.w = scaled->w;
|
||||
src_rect.h = scaled->h;
|
||||
|
||||
DEBUG_PRINTF("Blitting scaled image (%d x %d) into new 'src' image (%d x %d) at (%d,%d) %d x %d\n",
|
||||
scaled->w, scaled->h, src->w, src->h, src_rect.x, src_rect.y, src_rect.w, src_rect.h);
|
||||
DEBUG_PRINTF
|
||||
("Blitting scaled image (%d x %d) into new 'src' image (%d x %d) at (%d,%d) %d x %d\n",
|
||||
scaled->w, scaled->h, src->w, src->h, src_rect.x, src_rect.y, src_rect.w, src_rect.h);
|
||||
|
||||
SDL_BlitSurface(scaled, &src_rect, src, NULL);
|
||||
}
|
||||
|
|
@ -18060,7 +18088,8 @@ static int do_open(void)
|
|||
|
||||
do_setcursor(cursor_down);
|
||||
}
|
||||
else if (event.button.y >= (button_h * buttons_tall + r_ttools.h) - button_h
|
||||
else if (event.button.y >=
|
||||
(button_h * buttons_tall + r_ttools.h) - button_h
|
||||
&& event.button.y < (button_h * buttons_tall + r_ttools.h))
|
||||
{
|
||||
if (event.button.x >= r_ttools.w && event.button.x < r_ttools.w + (button_w * num_left_buttons))
|
||||
|
|
@ -18068,19 +18097,21 @@ static int do_open(void)
|
|||
/* One of the command buttons on the left: Open, Slides, Template [maybe] */
|
||||
do_setcursor(cursor_hand);
|
||||
}
|
||||
else if (event.button.x >= (WINDOW_WIDTH - r_ttoolopt.w - button_w)
|
||||
&& event.button.x < (WINDOW_WIDTH - r_ttoolopt.w))
|
||||
else if (event.button.x >=
|
||||
(WINDOW_WIDTH - r_ttoolopt.w - button_w) && event.button.x < (WINDOW_WIDTH - r_ttoolopt.w))
|
||||
{
|
||||
/* Command button on the right: Back */
|
||||
do_setcursor(cursor_hand);
|
||||
}
|
||||
else if (event.button.x >= (WINDOW_WIDTH - r_ttoolopt.w - button_w * 2)
|
||||
else if (event.button.x >=
|
||||
(WINDOW_WIDTH - r_ttoolopt.w - button_w * 2)
|
||||
&& event.button.x < (WINDOW_WIDTH - r_ttoolopt.w - button_w) && !disable_erase)
|
||||
{
|
||||
/* Command button on the right: Erase [maybe] */
|
||||
do_setcursor(cursor_hand);
|
||||
}
|
||||
else if (event.button.x >= (WINDOW_WIDTH - r_ttoolopt.w - button_w * 3)
|
||||
else if (event.button.x >=
|
||||
(WINDOW_WIDTH - r_ttoolopt.w - button_w * 3)
|
||||
&& event.button.x < (WINDOW_WIDTH - r_ttoolopt.w - button_w * 2))
|
||||
{
|
||||
/* Command button on the right: Export */
|
||||
|
|
@ -18324,11 +18355,11 @@ static int do_open(void)
|
|||
if (res == EXPORT_SUCCESS)
|
||||
do_prompt_snd(PROMPT_PICT_TEMPLATE_TXT, PROMPT_TEMPLATE_YES, "", SND_TUXOK, screen->w / 2, screen->h / 2);
|
||||
else if (res == EXPORT_ERR_ALREADY_EXPORTED)
|
||||
do_prompt_snd(PROMPT_PICT_TEMPLATE_EXISTS_TXT, PROMPT_TEMPLATE_YES,
|
||||
"", SND_YOUCANNOT, screen->w / 2, screen->h / 2);
|
||||
do_prompt_snd(PROMPT_PICT_TEMPLATE_EXISTS_TXT,
|
||||
PROMPT_TEMPLATE_YES, "", SND_YOUCANNOT, screen->w / 2, screen->h / 2);
|
||||
else
|
||||
do_prompt_snd(PROMPT_PICT_TEMPLATE_FAILED_TXT, PROMPT_TEMPLATE_YES,
|
||||
"", SND_YOUCANNOT, screen->w / 2, screen->h / 2);
|
||||
do_prompt_snd(PROMPT_PICT_TEMPLATE_FAILED_TXT,
|
||||
PROMPT_TEMPLATE_YES, "", SND_YOUCANNOT, screen->w / 2, screen->h / 2);
|
||||
|
||||
draw_tux_text(TUX_BORED, instructions, 1);
|
||||
update_list = 1;
|
||||
|
|
@ -21227,7 +21258,7 @@ static int valid_click(Uint8 button)
|
|||
*/
|
||||
static int in_circle_rad(int x, int y, int rad)
|
||||
{
|
||||
if (abs(x) > rad || abs(y) > rad) // short circuit to avoid unnecessary math
|
||||
if (abs(x) > rad || abs(y) > rad) // short circuit to avoid unnecessary math
|
||||
return (0);
|
||||
if ((x * x) + (y * y) - (rad * rad) < 0)
|
||||
return (1);
|
||||
|
|
@ -21704,6 +21735,7 @@ static SDL_Surface *myIMG_Load_RWops(const char *file)
|
|||
static SDL_Surface *myIMG_Load(const char *file)
|
||||
{
|
||||
struct stat stat_buf;
|
||||
|
||||
if (stat(file, &stat_buf) != 0)
|
||||
{
|
||||
/* File by that name doesn't exist; give up now */
|
||||
|
|
@ -22127,8 +22159,9 @@ static void load_magic_plugins(void)
|
|||
if (magics[group][j].order == magics[group][idx].order)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Warning: In group %d, tool %d (%s) has the same order (%d) as tool %d (%s)\n", group,
|
||||
idx, magics[group][idx].name, magics[group][j].order, j, magics[group][j].name);
|
||||
"Warning: In group %d, tool %d (%s) has the same order (%d) as tool %d (%s)\n",
|
||||
group, idx, magics[group][idx].name,
|
||||
magics[group][j].order, j, magics[group][j].name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -22153,8 +22186,8 @@ static void load_magic_plugins(void)
|
|||
magic_funcs[num_plugin_files].get_description(magic_api_struct, i, MODE_ONECLICK);
|
||||
else if (magics[group][idx].avail_modes & MODE_PAINT_WITH_PREVIEW)
|
||||
magics[group][idx].tip[j] =
|
||||
magic_funcs[num_plugin_files].get_description
|
||||
(magic_api_struct, i, MODE_PAINT_WITH_PREVIEW);
|
||||
magic_funcs[num_plugin_files].get_description(magic_api_struct, i,
|
||||
MODE_PAINT_WITH_PREVIEW);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -22194,13 +22227,13 @@ static void load_magic_plugins(void)
|
|||
{
|
||||
magics[group][idx].default_size[j] =
|
||||
magic_funcs[num_plugin_files].default_size(magic_api_struct, i, mode_bit);
|
||||
if (magics[group][idx].default_size[j] < 1 ||
|
||||
magics[group][idx].default_size[j] > magics[group][idx].sizes[j])
|
||||
if (magics[group][idx].default_size[j] < 1
|
||||
|| magics[group][idx].default_size[j] > magics[group][idx].sizes[j])
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Warning: plugin %s tool # %d for %d mode (%x) default size (%d) out of range (1-%d)\n",
|
||||
fname, i, j, mode_bit, magics[group][idx].default_size[j],
|
||||
magics[group][idx].sizes[j]);
|
||||
fname, i, j, mode_bit,
|
||||
magics[group][idx].default_size[j], magics[group][idx].sizes[j]);
|
||||
magics[group][idx].default_size[j] = 1;
|
||||
}
|
||||
magics[group][idx].size[j] = magics[group][idx].default_size[j];
|
||||
|
|
@ -22233,7 +22266,8 @@ static void load_magic_plugins(void)
|
|||
|
||||
if (num_magics[group] >= MAX_MAGICS_PER_GROUP)
|
||||
{
|
||||
fprintf(stderr, "Error: exceeded maximum number of Magic tools (%d) in group %d!\n",
|
||||
fprintf(stderr,
|
||||
"Error: exceeded maximum number of Magic tools (%d) in group %d!\n",
|
||||
MAX_MAGICS_PER_GROUP, group);
|
||||
num_magics[group]--; // FIXME: Do something better than just this! -bjk 2024.04.08
|
||||
}
|
||||
|
|
@ -23447,9 +23481,11 @@ static int do_new_dialog(void)
|
|||
done = 1;
|
||||
playsound(screen, 1, SND_CLICK, 1, SNDPOS_LEFT, SNDDIST_NEAR);
|
||||
}
|
||||
else if (erasable && event.button.x >= (WINDOW_WIDTH - r_ttoolopt.w - button_w * 2) &&
|
||||
event.button.x < (WINDOW_WIDTH - r_ttoolopt.w - button_w) &&
|
||||
event.button.y >=
|
||||
else if (erasable
|
||||
&& event.button.x >=
|
||||
(WINDOW_WIDTH - r_ttoolopt.w - button_w * 2)
|
||||
&& event.button.x < (WINDOW_WIDTH - r_ttoolopt.w - button_w)
|
||||
&& event.button.y >=
|
||||
(button_h * buttons_tall + r_ttools.h) - button_h
|
||||
&& event.button.y < (button_h * buttons_tall + r_ttools.h))
|
||||
{
|
||||
|
|
@ -23609,7 +23645,9 @@ static int do_new_dialog(void)
|
|||
else
|
||||
if (((event.button.x >= r_ttools.w
|
||||
&& event.button.x < r_ttools.w + button_w)
|
||||
|| (event.button.x >= (WINDOW_WIDTH - r_ttoolopt.w - button_w * (erasable ? 2 : 1))
|
||||
|| (event.button.x >=
|
||||
(WINDOW_WIDTH - r_ttoolopt.w -
|
||||
button_w * (erasable ? 2 : 1))
|
||||
&& event.button.x < (WINDOW_WIDTH - r_ttoolopt.w)
|
||||
&& d_places[which] != PLACE_STARTERS_DIR
|
||||
&& d_places[which] != PLACE_PERSONAL_STARTERS_DIR))
|
||||
|
|
@ -24886,7 +24924,8 @@ static int do_color_picker(int prev_color)
|
|||
done = 1;
|
||||
}
|
||||
}
|
||||
else if ((event.type == SDL_MOUSEBUTTONUP || event.type == SDL_MOUSEBUTTONDOWN) && valid_click(event.button.button))
|
||||
else
|
||||
if ((event.type == SDL_MOUSEBUTTONUP || event.type == SDL_MOUSEBUTTONDOWN) && valid_click(event.button.button))
|
||||
{
|
||||
if (event.button.x >= color_picker_left &&
|
||||
event.button.x < color_picker_left + img_color_picker->w &&
|
||||
|
|
@ -25068,7 +25107,8 @@ static int do_color_picker(int prev_color)
|
|||
{
|
||||
/* Click+drag? Fill whole box */
|
||||
SDL_FillRect(screen, &color_example_dest, SDL_MapRGB(screen->format, r, g, b));
|
||||
SDL_UpdateRect(screen, color_example_dest.x, color_example_dest.y, color_example_dest.w, color_example_dest.h);
|
||||
SDL_UpdateRect(screen, color_example_dest.x, color_example_dest.y,
|
||||
color_example_dest.w, color_example_dest.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -25118,7 +25158,8 @@ static int do_color_picker(int prev_color)
|
|||
{
|
||||
/* Click+drag? Fill whole box */
|
||||
SDL_FillRect(screen, &color_example_dest, SDL_MapRGB(screen->format, r, g, b));
|
||||
SDL_UpdateRect(screen, color_example_dest.x, color_example_dest.y, color_example_dest.w, color_example_dest.h);
|
||||
SDL_UpdateRect(screen, color_example_dest.x,
|
||||
color_example_dest.y, color_example_dest.w, color_example_dest.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -25144,7 +25185,8 @@ static int do_color_picker(int prev_color)
|
|||
dest.y = color_picker_top;
|
||||
SDL_BlitSurface(img_color_picker, NULL, screen, &dest);
|
||||
|
||||
draw_color_picker_crosshairs(color_picker_left, color_picker_top, color_picker_val_left, color_picker_val_top);
|
||||
draw_color_picker_crosshairs(color_picker_left,
|
||||
color_picker_top, color_picker_val_left, color_picker_val_top);
|
||||
dest.x = color_picker_left;
|
||||
dest.y = color_picker_top;
|
||||
dest.w = img_color_picker->w;
|
||||
|
|
@ -26588,7 +26630,8 @@ static void magic_set_size()
|
|||
|
||||
last = undo_bufs[undo_ctr];
|
||||
|
||||
DEBUG_PRINTF("set_size for mode %04x (%d) being set to %d\n", magics[magic_group][cur_magic[magic_group]].mode,
|
||||
DEBUG_PRINTF("set_size for mode %04x (%d) being set to %d\n",
|
||||
magics[magic_group][cur_magic[magic_group]].mode,
|
||||
magic_modeint(magics[magic_group][cur_magic[magic_group]].mode),
|
||||
magics[magic_group][cur_magic[magic_group]].size[magic_modeint
|
||||
(magics[magic_group][cur_magic[magic_group]].mode)]);
|
||||
|
|
@ -28726,7 +28769,8 @@ static void setup_config(char *argv[])
|
|||
{
|
||||
if (strcmp(tmpcfg.tp_ui_font, "default") == 0)
|
||||
{
|
||||
printf /*DEBUG_PRINTF */ ("Info: Requested default UI font, \"%s\"\n", PANGO_DEFAULT_FONT);
|
||||
printf /*DEBUG_PRINTF */ ("Info: Requested default UI font, \"%s\"\n",
|
||||
PANGO_DEFAULT_FONT);
|
||||
tp_ui_font = strdup(PANGO_DEFAULT_FONT);
|
||||
if (PANGO_DEFAULT_FONT_FALLBACK != NULL)
|
||||
{
|
||||
|
|
@ -28736,12 +28780,14 @@ static void setup_config(char *argv[])
|
|||
else
|
||||
{
|
||||
tp_ui_font = strdup(tmpcfg.tp_ui_font);
|
||||
printf /*DEBUG_PRINTF */ ("Info: Requested UI font described by \"%s\"\n", tp_ui_font);
|
||||
printf /*DEBUG_PRINTF */
|
||||
("Info: Requested UI font described by \"%s\"\n", tp_ui_font);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf /*DEBUG_PRINTF */ ("Info: Requested default UI font, \"%s\"\n", PANGO_DEFAULT_FONT);
|
||||
printf /*DEBUG_PRINTF */ ("Info: Requested default UI font, \"%s\"\n",
|
||||
PANGO_DEFAULT_FONT);
|
||||
tp_ui_font = strdup(PANGO_DEFAULT_FONT);
|
||||
if (PANGO_DEFAULT_FONT_FALLBACK != NULL)
|
||||
{
|
||||
|
|
@ -28762,7 +28808,8 @@ static void setup_config(char *argv[])
|
|||
/* FIXME: Unclear whether this is necessary? -bjk 2023.06.12 */
|
||||
DEBUG_PRINTF("Rescanning fonts...");
|
||||
fflush(stdout);
|
||||
FcDirCacheRead((const FcChar8 *)locale_fontdir, FcTrue /* force */ , FcConfigGetCurrent());
|
||||
FcDirCacheRead((const FcChar8 *)locale_fontdir, FcTrue /* force */ ,
|
||||
FcConfigGetCurrent());
|
||||
FcDirCacheRescan((const FcChar8 *)locale_fontdir, FcConfigGetCurrent());
|
||||
DEBUG_PRINTF("done\n");
|
||||
|
||||
|
|
@ -28791,7 +28838,8 @@ static void setup_config(char *argv[])
|
|||
tp_ui_font = strdup(tp_ui_font_fallback);
|
||||
tp_ui_font_fallback = NULL;
|
||||
|
||||
printf /*DEBUG_PRINTF */ ("Info: Requested fallback default UI font, \"%s\"\n", tp_ui_font);
|
||||
printf /*DEBUG_PRINTF */
|
||||
("Info: Requested fallback default UI font, \"%s\"\n", tp_ui_font);
|
||||
tmp_str = ask_pango_for_font(tp_ui_font);
|
||||
}
|
||||
}
|
||||
|
|
@ -28901,8 +28949,8 @@ static void setup_config(char *argv[])
|
|||
exit(1);
|
||||
}
|
||||
button_scale = (float)strtof(tmpcfg.button_size, NULL) / (float)ORIGINAL_BUTTON_SIZE;
|
||||
DEBUG_PRINTF("Button size %s requested = %d (scale = %f)\n", tmpcfg.button_size,
|
||||
(int)(button_scale * ORIGINAL_BUTTON_SIZE), button_scale);
|
||||
DEBUG_PRINTF("Button size %s requested = %d (scale = %f)\n",
|
||||
tmpcfg.button_size, (int)(button_scale * ORIGINAL_BUTTON_SIZE), button_scale);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -30090,13 +30138,16 @@ static void setup(void)
|
|||
/* Only found one display, and window size is larger? Use that window size */
|
||||
if (WINDOW_WIDTH > max_scrn_w)
|
||||
{
|
||||
fprintf(stderr, "Warning: Asked for window width (%d) larger than max screen width (%d)\n", WINDOW_WIDTH, max_scrn_w);
|
||||
fprintf(stderr,
|
||||
"Warning: Asked for window width (%d) larger than max screen width (%d)\n", WINDOW_WIDTH, max_scrn_w);
|
||||
WINDOW_WIDTH = max_scrn_w;
|
||||
}
|
||||
|
||||
if (WINDOW_HEIGHT > max_scrn_h)
|
||||
{
|
||||
fprintf(stderr, "Warning: Asked for window height (%d) larger than max screen height (%d)\n", WINDOW_HEIGHT, max_scrn_h);
|
||||
fprintf(stderr,
|
||||
"Warning: Asked for window height (%d) larger than max screen height (%d)\n",
|
||||
WINDOW_HEIGHT, max_scrn_h);
|
||||
WINDOW_HEIGHT = max_scrn_h;
|
||||
}
|
||||
}
|
||||
|
|
@ -30557,7 +30608,7 @@ static void setup(void)
|
|||
img_oskenter = loadimagerb(DATA_PREFIX "images/ui/osk_enter.png");
|
||||
img_oskcapslock = loadimagerb(DATA_PREFIX "images/ui/osk_capslock.png");
|
||||
img_oskshift = loadimagerb(DATA_PREFIX "images/ui/osk_shift.png");
|
||||
img_oskpaste = loadimagerb(DATA_PREFIX "images/ui/osk_shift.png"); // FIXME
|
||||
img_oskpaste = loadimagerb(DATA_PREFIX "images/ui/osk_shift.png"); // FIXME
|
||||
|
||||
if (onscreen_keyboard_layout)
|
||||
{
|
||||
|
|
@ -30570,8 +30621,7 @@ static void setup(void)
|
|||
img_btn_up, img_btn_down, img_btn_off,
|
||||
img_btn_nav, img_btn_hold,
|
||||
img_oskdel, img_osktab, img_oskenter,
|
||||
img_oskcapslock, img_oskshift, img_oskpaste,
|
||||
onscreen_keyboard_disable_change);
|
||||
img_oskcapslock, img_oskshift, img_oskpaste, onscreen_keyboard_disable_change);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -30580,8 +30630,7 @@ static void setup(void)
|
|||
img_btn_up, img_btn_down, img_btn_off,
|
||||
img_btn_nav, img_btn_hold,
|
||||
img_oskdel, img_osktab, img_oskenter,
|
||||
img_oskcapslock, img_oskshift, img_oskpaste,
|
||||
onscreen_keyboard_disable_change);
|
||||
img_oskcapslock, img_oskshift, img_oskpaste, onscreen_keyboard_disable_change);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -30813,11 +30862,9 @@ static void setup(void)
|
|||
SDL_MapRGB(img_color_btns
|
||||
[i + NUM_COLORS]->format,
|
||||
linear_to_sRGB(rh * aa +
|
||||
rd * (1.0 -
|
||||
aa)),
|
||||
rd * (1.0 - aa)),
|
||||
linear_to_sRGB(gh * aa +
|
||||
gd * (1.0 -
|
||||
aa)),
|
||||
gd * (1.0 - aa)),
|
||||
linear_to_sRGB(bh * aa +
|
||||
bd * (1.0 - aa))));
|
||||
}
|
||||
|
|
@ -31963,8 +32010,8 @@ char *get_xdg_user_dir(const char *dir_type, const char *fallback)
|
|||
* @param int speed -- how fast to play the slideshow (0 and 1 both = slowest, 10 = fasted)
|
||||
* @return int -- 0 if export failed or was aborted, 1 if successful
|
||||
*/
|
||||
static int export_gif(int *selected, int num_selected, char *dirname, char **d_names, char **d_exts, int speed,
|
||||
char **dest_fname)
|
||||
static int export_gif(int *selected, int num_selected, char *dirname,
|
||||
char **d_names, char **d_exts, int speed, char **dest_fname)
|
||||
{
|
||||
char *tmp_starter_id, *tmp_template_id, *tmp_file_id;
|
||||
int tmp_starter_mirrored, tmp_starter_flipped, tmp_starter_personal;
|
||||
|
|
@ -32385,14 +32432,16 @@ static int export_pict(char *fname, int where, char *orig_fname, char **dest_fna
|
|||
}
|
||||
else
|
||||
{
|
||||
DEBUG_PRINTF(" ...but dimensions differ (template = %d x %d, saved file is now %d x %d)\n",
|
||||
templ_w, templ_h, orig_w, orig_h);
|
||||
DEBUG_PRINTF
|
||||
(" ...but dimensions differ (template = %d x %d, saved file is now %d x %d)\n",
|
||||
templ_w, templ_h, orig_w, orig_h);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_PRINTF(" ...but file sizes differ (template = %ld bytes, saved file is now %ld bytes\n",
|
||||
sbuf_test.st_size, sbuf_orig.st_size);
|
||||
DEBUG_PRINTF
|
||||
(" ...but file sizes differ (template = %ld bytes, saved file is now %ld bytes\n",
|
||||
sbuf_test.st_size, sbuf_orig.st_size);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue