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
2
Makefile
2
Makefile
|
|
@ -15,7 +15,7 @@
|
||||||
VER_VERSION=0.9.18
|
VER_VERSION=0.9.18
|
||||||
VER_DATE=`date +"%Y-%m-%d"`
|
VER_DATE=`date +"%Y-%m-%d"`
|
||||||
|
|
||||||
MAGIC_API_VERSION=0x00000001
|
include magic/Makefile-apiversion
|
||||||
|
|
||||||
|
|
||||||
# Where to install things:
|
# Where to install things:
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
# part of Tux Paint base, so "install-plugin-dev" probably hasn't
|
# part of Tux Paint base, so "install-plugin-dev" probably hasn't
|
||||||
# been run yet; hence "-I../src/" to find 'tp_magic_api.h')
|
# been run yet; hence "-I../src/" to find 'tp_magic_api.h')
|
||||||
|
|
||||||
|
include Makefile-apiversion
|
||||||
|
|
||||||
SO_TYPE=so
|
SO_TYPE=so
|
||||||
|
|
||||||
TP_MAGIC_CFLAGS=$(shell sdl-config --cflags) \
|
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:
|
// Do the effect:
|
||||||
|
|
||||||
void do_example(void * ptr, int which, SDL_Surface * canvas, SDL_Surface * last,
|
void rainbow_linecb(void * ptr, int which,
|
||||||
int x, int y)
|
SDL_Surface * canvas, SDL_Surface * last,
|
||||||
|
int x, int y)
|
||||||
{
|
{
|
||||||
magic_api * api = (magic_api *) ptr;
|
magic_api * api = (magic_api *) ptr;
|
||||||
int xx, yy;
|
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][1],
|
||||||
rainbow_hexes[rainbow_color][2]);
|
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);
|
api->playsound(rainbow_snd, (x * 255) / canvas->w, 255);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue