Magic tools (and tp-magic-config) supports local (user) plugins.
Added copyright & credit info to new Magic tool plugin .c files. Updated Magic plugin doc API.
This commit is contained in:
parent
cf10090cc1
commit
0d6c2cf1b9
30 changed files with 1146 additions and 350 deletions
|
|
@ -1,3 +1,32 @@
|
|||
/*
|
||||
emboss.c
|
||||
|
||||
Emboss Magic Tool Plugin
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
Copyright (c) 2002-2007 by Bill Kendrick and others; see AUTHORS.txt
|
||||
bill@newbreedsoftware.com
|
||||
http://www.tuxpaint.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: August 7, 2007
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <libintl.h>
|
||||
|
|
@ -18,7 +47,7 @@ int emboss_init(magic_api * api)
|
|||
{
|
||||
char fname[1024];
|
||||
|
||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/emboss.wav",
|
||||
snprintf(fname, sizeof(fname), "%s/sounds/magic/emboss.ogg",
|
||||
api->data_directory);
|
||||
emboss_snd = Mix_LoadWAV(fname);
|
||||
|
||||
|
|
@ -104,7 +133,7 @@ void emboss_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
SDL_Surface * last, int ox, int oy, int x, int y,
|
||||
SDL_Rect * update_rect)
|
||||
{
|
||||
api->line(which, canvas, last, ox, oy, x, y, 1, do_emboss);
|
||||
api->line((void *) api, which, canvas, last, ox, oy, x, y, 1, do_emboss);
|
||||
|
||||
if (ox > x) { int tmp = ox; ox = x; x = tmp; }
|
||||
if (oy > y) { int tmp = oy; oy = y; y = tmp; }
|
||||
|
|
@ -115,7 +144,7 @@ void emboss_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
update_rect->h = (y + 16) - update_rect->h;
|
||||
|
||||
api->playsound(emboss_snd,
|
||||
(x * 255) / canvas->w, (y * 255) / canvas->h);
|
||||
(x * 255) / canvas->w, 255);
|
||||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue