Foam: Update for new API, always circular; new SFX
Never change aspect ratio of bubble image used by Foam. New sound effect, CC-0 by https://freesound.org/people/ristooooo1
This commit is contained in:
parent
4e54ad7704
commit
1d8e64362b
4 changed files with 48 additions and 8 deletions
|
|
@ -113,6 +113,12 @@ June 17, 2002 - April 20, 2023
|
||||||
(https://freesound.org/people/MrFossy/sounds/590303/)
|
(https://freesound.org/people/MrFossy/sounds/590303/)
|
||||||
Creative Commons 0 license by "MrFossy"
|
Creative Commons 0 license by "MrFossy"
|
||||||
|
|
||||||
|
Foam magic tool and artwork
|
||||||
|
by Bill Kendrick <bill@newbreedsoftware.com>
|
||||||
|
Foam sound effect: "Bubbles » Bubbles 004.wav"
|
||||||
|
(https://freesound.org/people/ristooooo1/sounds/539819/)
|
||||||
|
Creative Commons 0 license by "ristooooo1"
|
||||||
|
|
||||||
Maze magic tool and artwork
|
Maze magic tool and artwork
|
||||||
by Bill Kendrick <bill@newbreedsoftware.com>
|
by Bill Kendrick <bill@newbreedsoftware.com>
|
||||||
Maze sound effect: "01-35 Footsteps, Wood, Socks, Running 2.wav"
|
Maze sound effect: "01-35 Footsteps, Wood, Socks, Running 2.wav"
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ https://tuxpaint.org/
|
||||||
+ Bricks
|
+ Bricks
|
||||||
+ Clone
|
+ Clone
|
||||||
+ Confetti
|
+ Confetti
|
||||||
|
+ Foam
|
||||||
+ Googly Eyes
|
+ Googly Eyes
|
||||||
+ Light
|
+ Light
|
||||||
+ Metal Paint
|
+ Metal Paint
|
||||||
|
|
@ -60,6 +61,13 @@ https://tuxpaint.org/
|
||||||
* Clone performance improved.
|
* Clone performance improved.
|
||||||
Bill Kendrick <bill@newbreedsoftware.com>
|
Bill Kendrick <bill@newbreedsoftware.com>
|
||||||
|
|
||||||
|
* Foam bubbles now always appear circular.
|
||||||
|
Bill Kendrick <bill@newbreedsoftware.com>
|
||||||
|
|
||||||
|
* New Foam sound effect.
|
||||||
|
(Sound effect licensed as Creative Commons 0 by
|
||||||
|
https://freesound.org/people/ristooooo1)
|
||||||
|
|
||||||
* Other Improvements:
|
* Other Improvements:
|
||||||
-------------------
|
-------------------
|
||||||
* Word-wrap long button labels, for better readability.
|
* Word-wrap long button labels, for better readability.
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -23,7 +23,7 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
(See COPYING.txt)
|
(See COPYING.txt)
|
||||||
|
|
||||||
Last updated: February 12, 2023
|
Last updated: April 20, 2023
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -42,11 +42,12 @@ static int *foam_mask, *foam_mask_tmp;
|
||||||
static SDL_Surface *foam_7, *foam_5, *foam_3, *foam_1;
|
static SDL_Surface *foam_7, *foam_5, *foam_3, *foam_1;
|
||||||
|
|
||||||
Uint32 foam_api_version(void);
|
Uint32 foam_api_version(void);
|
||||||
int foam_init(magic_api * api);
|
int foam_init(magic_api * api, Uint32 disabled_features);
|
||||||
char *foam_get_description(magic_api * api, int which, int mode);
|
char *foam_get_description(magic_api * api, int which, int mode);
|
||||||
void foam_release(magic_api * api, int which,
|
void foam_release(magic_api * api, int which,
|
||||||
SDL_Surface * canvas, SDL_Surface * last, int x, int y,
|
SDL_Surface * canvas, SDL_Surface * last, int x, int y,
|
||||||
SDL_Rect * update_rect);
|
SDL_Rect * update_rect);
|
||||||
|
void foam_release_worker(SDL_Surface * canvas, SDL_Surface* last, SDL_Rect * update_rect);
|
||||||
void foam_drag(magic_api * api, int which, SDL_Surface * canvas,
|
void foam_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||||
SDL_Surface * last, int ox, int oy, int x, int y,
|
SDL_Surface * last, int ox, int oy, int x, int y,
|
||||||
SDL_Rect * update_rect);
|
SDL_Rect * update_rect);
|
||||||
|
|
@ -67,6 +68,9 @@ void foam_shutdown(magic_api * api);
|
||||||
int foam_get_tool_count(magic_api * api);
|
int foam_get_tool_count(magic_api * api);
|
||||||
int foam_modes(magic_api * api, int which);
|
int foam_modes(magic_api * api, int which);
|
||||||
int foam_requires_colors(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);
|
||||||
|
|
||||||
#define FOAM_PROP 8
|
#define FOAM_PROP 8
|
||||||
#define FOAM_RADIUS 3
|
#define FOAM_RADIUS 3
|
||||||
|
|
@ -78,7 +82,7 @@ Uint32 foam_api_version(void)
|
||||||
|
|
||||||
|
|
||||||
// No setup required:
|
// No setup required:
|
||||||
int foam_init(magic_api * api)
|
int foam_init(magic_api * api, Uint32 disabled_features ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
char fname[1024];
|
char fname[1024];
|
||||||
SDL_Surface *foam_data;
|
SDL_Surface *foam_data;
|
||||||
|
|
@ -93,16 +97,16 @@ int foam_init(magic_api * api)
|
||||||
|
|
||||||
foam_7 =
|
foam_7 =
|
||||||
api->scale(foam_data, ((api->canvas_w / FOAM_PROP) * 4) / 4,
|
api->scale(foam_data, ((api->canvas_w / FOAM_PROP) * 4) / 4,
|
||||||
((api->canvas_h / FOAM_PROP) * 4) / 4, 0);
|
((api->canvas_h / FOAM_PROP) * 4) / 4, 1);
|
||||||
foam_5 =
|
foam_5 =
|
||||||
api->scale(foam_data, ((api->canvas_w / FOAM_PROP) * 3) / 4,
|
api->scale(foam_data, ((api->canvas_w / FOAM_PROP) * 3) / 4,
|
||||||
((api->canvas_h / FOAM_PROP) * 3) / 4, 0);
|
((api->canvas_h / FOAM_PROP) * 3) / 4, 1);
|
||||||
foam_3 =
|
foam_3 =
|
||||||
api->scale(foam_data, ((api->canvas_w / FOAM_PROP) * 2) / 4,
|
api->scale(foam_data, ((api->canvas_w / FOAM_PROP) * 2) / 4,
|
||||||
((api->canvas_h / FOAM_PROP) * 2) / 4, 0);
|
((api->canvas_h / FOAM_PROP) * 2) / 4, 1);
|
||||||
foam_1 =
|
foam_1 =
|
||||||
api->scale(foam_data, ((api->canvas_w / FOAM_PROP) * 1) / 4,
|
api->scale(foam_data, ((api->canvas_w / FOAM_PROP) * 1) / 4,
|
||||||
((api->canvas_h / FOAM_PROP) * 1) / 4, 0);
|
((api->canvas_h / FOAM_PROP) * 1) / 4, 1);
|
||||||
|
|
||||||
SDL_FreeSurface(foam_data);
|
SDL_FreeSurface(foam_data);
|
||||||
|
|
||||||
|
|
@ -186,7 +190,8 @@ void foam_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||||
{
|
{
|
||||||
api->line((void *) api, which, canvas, last, ox, oy, x, y, 1, do_foam);
|
api->line((void *) api, which, canvas, last, ox, oy, x, y, 1, do_foam);
|
||||||
|
|
||||||
foam_release(api, which, canvas, last, x, y, update_rect);
|
foam_release_worker(canvas, last, update_rect);
|
||||||
|
// foam_release(api, which, canvas, last, x, y, update_rect);
|
||||||
|
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
if (ox > x)
|
if (ox > x)
|
||||||
|
|
@ -262,6 +267,12 @@ void foam_release(magic_api * api ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED,
|
||||||
int which ATTRIBUTE_UNUSED, SDL_Surface * canvas,
|
int which ATTRIBUTE_UNUSED, SDL_Surface * canvas,
|
||||||
SDL_Surface * last, int x ATTRIBUTE_UNUSED,
|
SDL_Surface * last, int x ATTRIBUTE_UNUSED,
|
||||||
int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect)
|
int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect)
|
||||||
|
{
|
||||||
|
api->stopsound();
|
||||||
|
foam_release_worker(canvas, last, update_rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
void foam_release_worker(SDL_Surface * canvas, SDL_Surface* last, SDL_Rect * update_rect)
|
||||||
{
|
{
|
||||||
int xx, yy;
|
int xx, yy;
|
||||||
int changes, max_iters;
|
int changes, max_iters;
|
||||||
|
|
@ -491,3 +502,18 @@ int foam_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return (MODE_PAINT);
|
return (MODE_PAINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Uint8 foam_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Uint8 foam_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
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, Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue