Moved Magic tool API version definition to a shared Makefile.

This commit is contained in:
William Kendrick 2007-07-08 08:02:55 +00:00
parent 202c638536
commit f1dac48175
4 changed files with 8 additions and 4 deletions

View file

@ -5,6 +5,8 @@
# part of Tux Paint base, so "install-plugin-dev" probably hasn't
# been run yet; hence "-I../src/" to find 'tp_magic_api.h')
include Makefile-apiversion
SO_TYPE=so
TP_MAGIC_CFLAGS=$(shell sdl-config --cflags) \

View file

@ -0,0 +1 @@
MAGIC_API_VERSION=0x00000001

View file

@ -88,8 +88,9 @@ char * rainbow_get_description(magic_api * api, int which)
// Do the effect:
void do_example(void * ptr, int which, SDL_Surface * canvas, SDL_Surface * last,
int x, int y)
void rainbow_linecb(void * ptr, int which,
SDL_Surface * canvas, SDL_Surface * last,
int x, int y)
{
magic_api * api = (magic_api *) ptr;
int xx, yy;
@ -116,7 +117,7 @@ void rainbow_drag(magic_api * api, int which, SDL_Surface * canvas,
rainbow_hexes[rainbow_color][1],
rainbow_hexes[rainbow_color][2]);
api->line(which, canvas, last, ox, oy, x, y, 1, do_example);
api->line(which, canvas, last, ox, oy, x, y, 1, rainbow_linecb);
api->playsound(rainbow_snd, (x * 255) / canvas->w, 255);
}