Maze magic tool - sound effect
This commit is contained in:
parent
49f70c60d8
commit
29a2d148b2
4 changed files with 23 additions and 13 deletions
|
|
@ -6,7 +6,7 @@ Copyright (c) 2002-2023
|
||||||
Various contributors (see below, and CHANGES.txt)
|
Various contributors (see below, and CHANGES.txt)
|
||||||
https://tuxpaint.org/
|
https://tuxpaint.org/
|
||||||
|
|
||||||
June 17, 2002 - January 7, 2023
|
June 17, 2002 - January 26, 2023
|
||||||
|
|
||||||
* Design and Coding:
|
* Design and Coding:
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@ June 17, 2002 - January 7, 2023
|
||||||
Albert Cahalan <albert@users.sf.net>
|
Albert Cahalan <albert@users.sf.net>
|
||||||
|
|
||||||
Bilinear interpolation code based on an example by Christian Graus
|
Bilinear interpolation code based on an example by Christian Graus
|
||||||
( http://www.codeproject.com/cs/media/imageprocessing4.asp ).
|
(http://www.codeproject.com/cs/media/imageprocessing4.asp)
|
||||||
|
|
||||||
Input Method (IM) Framework implemented by:
|
Input Method (IM) Framework implemented by:
|
||||||
Mark K. Kim <markuskimius@gmail.com>
|
Mark K. Kim <markuskimius@gmail.com>
|
||||||
|
|
@ -109,6 +109,12 @@ June 17, 2002 - January 7, 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"
|
||||||
|
|
||||||
|
Maze magic tool and artwork
|
||||||
|
by Bill Kendrick <bill@newbreedsoftware.com>
|
||||||
|
Maze sound effect: "01-35 Footsteps, Wood, Socks, Running 2.wav"
|
||||||
|
(https://freesound.org/people/SpliceSound/sounds/369834/)
|
||||||
|
Creative Commons 0 by Julian Evans <https://www.julianevans.info/>
|
||||||
|
|
||||||
Mouse accessibility code and keyboard access
|
Mouse accessibility code and keyboard access
|
||||||
Ankit Choudary <ankit.goaldecided@gmail.com>, as part of GSOC 2010,
|
Ankit Choudary <ankit.goaldecided@gmail.com>, as part of GSOC 2010,
|
||||||
with integration and fixes by Pere Pujal i Carabantes <pere@fornol.no-ip.org>
|
with integration and fixes by Pere Pujal i Carabantes <pere@fornol.no-ip.org>
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ https://tuxpaint.org/
|
||||||
- needs sound effect
|
- needs sound effect
|
||||||
- effect needs improvement
|
- effect needs improvement
|
||||||
|
|
||||||
* [WIP] "Maze"; draw a maze pattern over part or all of
|
* "Maze"; draw a maze pattern over part or all of your drawing.
|
||||||
your drawing.
|
(Sound effect licensed as Creative Commons 0 by
|
||||||
- needs sound effect
|
Julian Evans, https://www.julianevans.info/)
|
||||||
|
|
||||||
* Improvements to Magic Tools:
|
* Improvements to Magic Tools:
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
|
||||||
BIN
magic/sounds/maze.ogg
Normal file
BIN
magic/sounds/maze.ogg
Normal file
Binary file not shown.
|
|
@ -85,10 +85,9 @@ int maze_init(magic_api * api)
|
||||||
{
|
{
|
||||||
char fname[1024];
|
char fname[1024];
|
||||||
|
|
||||||
/* FIXME */
|
snprintf(fname, sizeof(fname), "%ssounds/magic/maze.ogg",
|
||||||
// snprintf(fname, sizeof(fname), "%ssounds/magic/maze.ogg",
|
api->data_directory);
|
||||||
// api->data_directory);
|
snd_effect = Mix_LoadWAV(fname);
|
||||||
// snd_effect = Mix_LoadWAV(fname);
|
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
@ -179,10 +178,7 @@ maze_click(magic_api * api, int which, int mode,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (snd_effect != NULL)
|
if (snd_effect != NULL)
|
||||||
{
|
|
||||||
api->stopsound();
|
api->stopsound();
|
||||||
api->playsound(snd_effect, (x * 255) / canvas->w, 255);
|
|
||||||
}
|
|
||||||
|
|
||||||
maze_start_x = floor(x / MAZE_BLOCK_SIZE) * MAZE_BLOCK_SIZE + (MAZE_BLOCK_SIZE / 2);
|
maze_start_x = floor(x / MAZE_BLOCK_SIZE) * MAZE_BLOCK_SIZE + (MAZE_BLOCK_SIZE / 2);
|
||||||
maze_start_y = floor(y / MAZE_BLOCK_SIZE) * MAZE_BLOCK_SIZE + (MAZE_BLOCK_SIZE / 2);
|
maze_start_y = floor(y / MAZE_BLOCK_SIZE) * MAZE_BLOCK_SIZE + (MAZE_BLOCK_SIZE / 2);
|
||||||
|
|
@ -201,6 +197,8 @@ maze_click(magic_api * api, int which, int mode,
|
||||||
for (x = 0; x < canvas->w; x++)
|
for (x = 0; x < canvas->w; x++)
|
||||||
maze_color[y * canvas->w + x] = color;
|
maze_color[y * canvas->w + x] = color;
|
||||||
|
|
||||||
|
api->playsound(snd_effect, 128, 255);
|
||||||
|
|
||||||
maze_render(api, canvas);
|
maze_render(api, canvas);
|
||||||
|
|
||||||
num_maze_starts = 0;
|
num_maze_starts = 0;
|
||||||
|
|
@ -235,6 +233,9 @@ void maze_release(magic_api * api, int which ATTRIBUTE_UNUSED,
|
||||||
SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED,
|
SDL_Surface * canvas, SDL_Surface * snapshot ATTRIBUTE_UNUSED,
|
||||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED,
|
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED,
|
||||||
SDL_Rect * update_rect) {
|
SDL_Rect * update_rect) {
|
||||||
|
if (snd_effect != NULL)
|
||||||
|
api->stopsound();
|
||||||
|
|
||||||
maze_collapse_contiguous(canvas);
|
maze_collapse_contiguous(canvas);
|
||||||
|
|
||||||
maze_add_start();
|
maze_add_start();
|
||||||
|
|
@ -361,6 +362,9 @@ void maze_line_callback_drag(void *ptr, int which ATTRIBUTE_UNUSED,
|
||||||
int xx, yy, idx;
|
int xx, yy, idx;
|
||||||
Uint32 color;
|
Uint32 color;
|
||||||
|
|
||||||
|
if (snd_effect != NULL)
|
||||||
|
api->playsound(snd_effect, (x * 255) / canvas->w, 255);
|
||||||
|
|
||||||
color = SDL_MapRGB(canvas->format, maze_r, maze_g, maze_b);
|
color = SDL_MapRGB(canvas->format, maze_r, maze_g, maze_b);
|
||||||
|
|
||||||
x = floor(x / (MAZE_BLOCK_SIZE * 3)) * (MAZE_BLOCK_SIZE * 3);
|
x = floor(x / (MAZE_BLOCK_SIZE * 3)) * (MAZE_BLOCK_SIZE * 3);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue