Moved Magic tool API version definition to a shared Makefile.
This commit is contained in:
parent
202c638536
commit
f1dac48175
4 changed files with 8 additions and 4 deletions
|
|
@ -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) \
|
||||
|
|
|
|||
1
magic/Makefile-apiversion
Normal file
1
magic/Makefile-apiversion
Normal file
|
|
@ -0,0 +1 @@
|
|||
MAGIC_API_VERSION=0x00000001
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue